Skip to content

Commit

Permalink
Expand 'typing' reqs to all python versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirosen committed Oct 20, 2023
1 parent e4da119 commit b392326
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 4 deletions.
43 changes: 43 additions & 0 deletions requirements/py3.10/typing.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions requirements/py3.11/typing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
41 changes: 41 additions & 0 deletions requirements/py3.12/typing.txt
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions requirements/py3.7/typing.txt
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions requirements/py3.8/typing.txt
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions requirements/py3.9/typing.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b392326

Please sign in to comment.