Skip to content

Conversation

@tsibley
Copy link
Contributor

@tsibley tsibley commented Feb 27, 2023

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:

nextstrain/cli/remote/nextstrain_dot_org.py:230: error: Self? has no attribute "auth"

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

  • Checks pass

…py on 3.6

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:

    nextstrain/cli/remote/nextstrain_dot_org.py:230: error: Self? has no attribute "auth"

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>
@tsibley tsibley requested a review from a team February 27, 2023 22:34
tsibley added a commit that referenced this pull request Feb 27, 2023
Changes to external dependencies, like new releases of Python packages,
are a common source of build breakage.¹  Ensure we know sooner than
later when they break our build by running CI every day.

¹ The latest example is <#257>.
@tsibley tsibley merged commit 1602e47 into master Feb 28, 2023
@tsibley tsibley deleted the trs/ci/mypy-failures-on-3.6 branch February 28, 2023 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants