dev: Pin types-requests on Python 3.6 to a version that works with mypy on 3.6 #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mypy 0.971 is the last version to support Python 3.6, so this is what pip installs on 3.6.
types-requests 2.28.11.12 is the last version to support mypy <1.0.0, due to changes in how the "Self" type is handled.¹ However, there's no way to declare that in package metadata (without requiring mypy, which is inappropriate for a typeshed package), so we have to resolve this dependency ourselves.²
With a too-new types-requests, mypy fails on 3.6 with errors like:
which we saw in CI failures.³
We'll drop support for Python 3.6 sooner than later, but for now, keep it going.
¹ python/typeshed@7180d02
python/typeshed#9702
² It would be possible if, for example, Python package metadata
supported a "Conflicts" field, as many packaging systems do.
³ https://github.com/nextstrain/cli/actions/runs/4266385449/jobs/7426841852#step:5:78
Testing