Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address deprecation warning for 'itsdangerous.json' #4950

Closed
2 of 3 tasks
lbeaufort opened this issue Sep 9, 2021 · 1 comment · Fixed by #4963
Closed
2 of 3 tasks

Address deprecation warning for 'itsdangerous.json' #4950

lbeaufort opened this issue Sep 9, 2021 · 1 comment · Fixed by #4963
Assignees
Milestone

Comments

@lbeaufort
Copy link
Member

lbeaufort commented Sep 9, 2021

What we’re after

Tests in CircleCI are flagging an issue with Flask where it's using deprecated functionality:

tests/test_sched_e.py::TestScheduleEByCandidateView::test_sort_bad_column
  /home/circleci/repo/venv/lib/python3.7/site-packages/flask/json/__init__.py:211: DeprecationWarning: Importing 'itsdangerous.json' is deprecated and will be removed in ItsDangerous 2.1. Use Python's 'json' module instead.
    rv = _json.dumps(obj, **kwargs)

Action item(s)

Completion criteria

  • Warning no longer shows when running tests
@lbeaufort lbeaufort added this to the Sprint 16.1 milestone Sep 13, 2021
@lbeaufort lbeaufort changed the title Pytest warning: Importing 'itsdangerous.json' is deprecated Address deprecation warning for 'itsdangerous.json' Sep 28, 2021
@pkfec
Copy link
Contributor

pkfec commented Oct 5, 2021

Updating flask to a minor version 1.1.4 didn't make any difference. And when updated to major version 2.0.1, pytest failed due to *other package dependencies.

While running pytest in circleci and local env, below 3 different deprecation warning messages appear on the console/terminal. Had to pin packages to a specific versions to address the depreciation warnings.

  1. /home/circleci/repo/venv/lib/python3.7/site-packages/flask/json/__init__.py:211: DeprecationWarning: Importing itsdangerous.json is deprecated and will be removed in ItsDangerous 2.1. Use Python's json module instead. rv = _json.dumps(obj, **kwargs)
  • In requirements.txt pinned itsdangerous==1.1.0

2: /home/circleci/repo/venv/lib/python3.7/site-packages/flake8/plugins/manager.py:254: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. eps = importlib_metadata.entry_points().get(self.namespace, ())
see here for more details: python/importlib_metadata#298

  • In requirements.txt pinned importlib-metadata==3.10.1

3: /Users/pkasireddy/.pyenv/versions/3.7.10/envs/test-4950/lib/python3.7/site-packages/jsonschema/validators.py:197: DeprecationWarning: Passing a schema to Validator.iter_errors is deprecated and will be removed in a future release. Call validator.evolve(schema=new_schema).iter_errors(...) instead

  • In requirements.txt pinned jsonschema==3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants