From 440253dd1a7a15a445e559712aba4b6b71788791 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Fri, 11 Feb 2022 20:31:42 +0000 Subject: [PATCH] Set a floor for versions of typing_extensions `typing_extensions>=4` is required (where typing_extensions is required). This is tested in tox both with `mypy-mindeps` and with `py36-mindeps`. The mypy run is only done in GH Actions to reduce the time spent on this when running `make lint`, as it is unlikely to fail. The `typing` repo has a discussion about capping or not capping the version of `typing_extensions`, but it is not well-resolved. For now, do not apply a cap to the version of `typing_extensions`. We can revisit this if the lack of a cap ever becomes an issue. --- .github/workflows/build.yaml | 2 +- changelog.d/20220211_202511_sirosen_bound_te.rst | 3 +++ setup.py | 2 +- tox.ini | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelog.d/20220211_202511_sirosen_bound_te.rst diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4bea179af..9cb2bc1fe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,7 +21,7 @@ jobs: - name: install tox run: python -m pip install -U tox - name: run linting - run: tox -e mypy,pylint + run: tox -e mypy,pylint,mypy-mindeps test: strategy: diff --git a/changelog.d/20220211_202511_sirosen_bound_te.rst b/changelog.d/20220211_202511_sirosen_bound_te.rst new file mode 100644 index 000000000..0f19bb791 --- /dev/null +++ b/changelog.d/20220211_202511_sirosen_bound_te.rst @@ -0,0 +1,3 @@ +* The ``typing_extensions`` requirement in package metadata now sets a lower + bound of ``4.0``, to force upgrades of installations to get a new enough version + (:pr:`NUMBER`) diff --git a/setup.py b/setup.py index 31c9cc5b5..73716ca47 100644 --- a/setup.py +++ b/setup.py @@ -79,7 +79,7 @@ def read_readme(): "cryptography>=3.3.1,!=3.4.0", # depend on the latest version of typing-extensions on python versions which do # not have all of the typing features we use - 'typing_extensions;python_version<"3.10"', + 'typing_extensions>=4.0;python_version<"3.10"', ], extras_require={"dev": DEV_REQUIREMENTS}, keywords=["globus"], diff --git a/tox.ini b/tox.ini index ef9cddcef..5bbb43276 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,7 @@ deps = mindeps: requests==2.19.1 mindeps: pyjwt==2.0.0 mindeps: cryptography==3.3.1 + mindeps: typing_extensions==4.0 commands = coverage run -m pytest {posargs} depends = py36,py37,py38,py39,py36-mindeps: cov-clean @@ -41,8 +42,9 @@ deps = pre-commit<3 skip_install = true commands = pre-commit run --all-files -[testenv:mypy] +[testenv:mypy{,-mindeps}] deps = mypy + mindeps: typing_extensions==4.0 commands = mypy src/ [testenv:pylint]