From b392326b7610958242d19c3267a5543e94ccd40a Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Fri, 20 Oct 2023 11:59:08 -0500 Subject: [PATCH] Expand 'typing' reqs to all python versions We were building our pinned requirements data for typing only under the python version used for `mypy` linting in CI: Python 3.11. This makes mypy-linting of code non-functional on lower interpreter versions. While some SDK developers are using pyenv or a similar solution to install multiple pythons in their home dirs, so we didn't notice the constraint, this is not meant to be a requirement for all contributors. To make `tox r -e mypy` work on all pythons, the `tox` target for "freezedeps" has been modified to generate the extra requirements, and the freezedeps job has been run. The fix was verified with tox r -e mypy --discover $(which python3.7) tox r -e mypy --discover $(which python3.9) It is possible that this will cause some drift and issues, especially around our lower-bound for python version (e.g. latest `mypy` drops support for a version we use), but at present such issues are speculative. We can deal with additional tightening of bounds and adjustments to CI to run some of these versions in the future. --- requirements/py3.10/typing.txt | 43 +++++++++++++++++++++++++++++++ requirements/py3.11/typing.txt | 4 +-- requirements/py3.12/typing.txt | 41 ++++++++++++++++++++++++++++++ requirements/py3.7/typing.txt | 46 ++++++++++++++++++++++++++++++++++ requirements/py3.8/typing.txt | 43 +++++++++++++++++++++++++++++++ requirements/py3.9/typing.txt | 43 +++++++++++++++++++++++++++++++ tox.ini | 4 +-- 7 files changed, 220 insertions(+), 4 deletions(-) create mode 100644 requirements/py3.10/typing.txt create mode 100644 requirements/py3.12/typing.txt create mode 100644 requirements/py3.7/typing.txt create mode 100644 requirements/py3.8/typing.txt create mode 100644 requirements/py3.9/typing.txt diff --git a/requirements/py3.10/typing.txt b/requirements/py3.10/typing.txt new file mode 100644 index 000000000..a6c307ac4 --- /dev/null +++ b/requirements/py3.10/typing.txt @@ -0,0 +1,43 @@ +# +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: +# +# tox p -m freezedeps +# +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.0 + # via requests +idna==3.4 + # via requests +mypy==1.6.1 + # via -r typing.in +mypy-extensions==1.0.0 + # via mypy +pyyaml==6.0.1 + # via responses +requests==2.31.0 + # via responses +responses==0.23.3 + # via -r typing.in +tomli==2.0.1 + # via mypy +types-cryptography==3.3.23.2 + # via types-jwt +types-docutils==0.20.0.3 + # via -r typing.in +types-jwt==0.1.3 + # via -r typing.in +types-pyyaml==6.0.12.12 + # via responses +types-requests==2.31.0.10 + # via -r typing.in +typing-extensions==4.8.0 + # via + # -r typing.in + # mypy +urllib3==2.0.7 + # via + # requests + # responses + # types-requests diff --git a/requirements/py3.11/typing.txt b/requirements/py3.11/typing.txt index e50c8c4e4..803491a52 100644 --- a/requirements/py3.11/typing.txt +++ b/requirements/py3.11/typing.txt @@ -10,7 +10,7 @@ charset-normalizer==3.3.0 # via requests idna==3.4 # via requests -mypy==1.6.0 +mypy==1.6.1 # via -r typing.in mypy-extensions==1.0.0 # via mypy @@ -28,7 +28,7 @@ types-jwt==0.1.3 # via -r typing.in types-pyyaml==6.0.12.12 # via responses -types-requests==2.31.0.9 +types-requests==2.31.0.10 # via -r typing.in typing-extensions==4.8.0 # via diff --git a/requirements/py3.12/typing.txt b/requirements/py3.12/typing.txt new file mode 100644 index 000000000..5f41678c6 --- /dev/null +++ b/requirements/py3.12/typing.txt @@ -0,0 +1,41 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# tox p -m freezedeps +# +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.0 + # via requests +idna==3.4 + # via requests +mypy==1.6.1 + # via -r typing.in +mypy-extensions==1.0.0 + # via mypy +pyyaml==6.0.1 + # via responses +requests==2.31.0 + # via responses +responses==0.23.3 + # via -r typing.in +types-cryptography==3.3.23.2 + # via types-jwt +types-docutils==0.20.0.3 + # via -r typing.in +types-jwt==0.1.3 + # via -r typing.in +types-pyyaml==6.0.12.12 + # via responses +types-requests==2.31.0.10 + # via -r typing.in +typing-extensions==4.8.0 + # via + # -r typing.in + # mypy +urllib3==2.0.7 + # via + # requests + # responses + # types-requests diff --git a/requirements/py3.7/typing.txt b/requirements/py3.7/typing.txt new file mode 100644 index 000000000..cc4a56689 --- /dev/null +++ b/requirements/py3.7/typing.txt @@ -0,0 +1,46 @@ +# +# This file is autogenerated by pip-compile with Python 3.7 +# by the following command: +# +# tox p -m freezedeps +# +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.0 + # via requests +idna==3.4 + # via requests +mypy==1.4.1 + # via -r typing.in +mypy-extensions==1.0.0 + # via mypy +pyyaml==6.0.1 + # via responses +requests==2.31.0 + # via responses +responses==0.23.3 + # via -r typing.in +tomli==2.0.1 + # via mypy +typed-ast==1.5.5 + # via mypy +types-cryptography==3.3.23.2 + # via types-jwt +types-docutils==0.20.0.3 + # via -r typing.in +types-jwt==0.1.3 + # via -r typing.in +types-pyyaml==6.0.12.12 + # via responses +types-requests==2.31.0.10 + # via -r typing.in +typing-extensions==4.7.1 + # via + # -r typing.in + # mypy + # responses +urllib3==2.0.7 + # via + # requests + # responses + # types-requests diff --git a/requirements/py3.8/typing.txt b/requirements/py3.8/typing.txt new file mode 100644 index 000000000..55362f4e8 --- /dev/null +++ b/requirements/py3.8/typing.txt @@ -0,0 +1,43 @@ +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# tox p -m freezedeps +# +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.0 + # via requests +idna==3.4 + # via requests +mypy==1.6.1 + # via -r typing.in +mypy-extensions==1.0.0 + # via mypy +pyyaml==6.0.1 + # via responses +requests==2.31.0 + # via responses +responses==0.23.3 + # via -r typing.in +tomli==2.0.1 + # via mypy +types-cryptography==3.3.23.2 + # via types-jwt +types-docutils==0.20.0.3 + # via -r typing.in +types-jwt==0.1.3 + # via -r typing.in +types-pyyaml==6.0.12.12 + # via responses +types-requests==2.31.0.10 + # via -r typing.in +typing-extensions==4.8.0 + # via + # -r typing.in + # mypy +urllib3==2.0.7 + # via + # requests + # responses + # types-requests diff --git a/requirements/py3.9/typing.txt b/requirements/py3.9/typing.txt new file mode 100644 index 000000000..38a48086c --- /dev/null +++ b/requirements/py3.9/typing.txt @@ -0,0 +1,43 @@ +# +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: +# +# tox p -m freezedeps +# +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.0 + # via requests +idna==3.4 + # via requests +mypy==1.6.1 + # via -r typing.in +mypy-extensions==1.0.0 + # via mypy +pyyaml==6.0.1 + # via responses +requests==2.31.0 + # via responses +responses==0.23.3 + # via -r typing.in +tomli==2.0.1 + # via mypy +types-cryptography==3.3.23.2 + # via types-jwt +types-docutils==0.20.0.3 + # via -r typing.in +types-jwt==0.1.3 + # via -r typing.in +types-pyyaml==6.0.12.12 + # via responses +types-requests==2.31.0.10 + # via -r typing.in +typing-extensions==4.8.0 + # via + # -r typing.in + # mypy +urllib3==2.0.7 + # via + # requests + # responses + # types-requests diff --git a/tox.ini b/tox.ini index 129ee40e0..612132e95 100644 --- a/tox.ini +++ b/tox.ini @@ -114,13 +114,13 @@ deps = py37: pip<=23.1 commands = pip-compile --strip-extras -q -U --resolver=backtracking test.in -o py{py_dot_ver}/test.txt + pip-compile --strip-extras -q -U --resolver=backtracking typing.in -o py{py_dot_ver}/typing.txt # Minimum dependencies are only tested against the lowest supported Python version. py37: pip-compile --strip-extras -q -U --resolver=backtracking test-mindeps.in -o py{py_dot_ver}/test-mindeps.txt - # The docs and typing requirements are only generated for Python 3.11. + # The docs requirements are only generated for Python 3.11. py311: pip-compile --strip-extras -q -U --resolver=backtracking docs.in -o py{py_dot_ver}/docs.txt - py311: pip-compile --strip-extras -q -U --resolver=backtracking typing.in -o py{py_dot_ver}/typing.txt [testenv:check-min-python-is-tested] description = Check the Requires-Python metadata against CI config