Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make typing_extensions required on all Python versions #11487

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

jakelishman
Copy link
Member

@jakelishman jakelishman commented Jan 4, 2024

Summary

The extent of our use of typing_extensions has fluctuated over time, but we've often had a dependency on it. This is typically not an onerous dependency, being pure Python, and is not uncommon for other packages.

We've often had an upper limit on the Python version for it, just for the principle of least requirements, but this has led to a subtle bug recently where we began using a Python 3.12 feature from it (Unpack) with the requirement left at python_version<'3.11' from before. This was caught by our nightly full test suite, but for unrelated reasons, that's not commenting correctly on issues at the moment. This error is quite likely to repeat; we only use the backport package for Python versions that aren't the newest, but our PR CI tests only oldest and newest.

This commit simply lifts the upper limit on the package; the impact should be minimal since most environments will already be installing it.

Details and comments

main currently cannot be imported on Python 3.11 without a fix.

The problem was introduced in #8268, but it could have been any PR updating the typing, and this is the kind of infrequent bug our full-matrix nightly CI is supposed to catch - it would be overkill to revert to the full matrix in PR CI and destroy our throughput.

The extent of our use of `typing_extensions` has fluctuated over time,
but we've often had a dependency on it.  This is typically not an
onerous dependency, being pure Python, and is not uncommon for other
packages.

We've often had an upper limit on the Python version for it, just for
the principle of least requirements, but this has led to a subtle bug
recently where we began using a Python 3.12 feature from it (`Unpack`)
with the requirement left at `python_version<'3.11'` from before.  This
was caught by our nightly full test suite, but for unrelated reasons,
that's not commenting correctly on issues at the moment.  This error is
quite likely to repeat; we only use the backport package for Python
versions that _aren't_ the newest, but our PR CI tests only oldest and
newest.

This commit simply lifts the upper limit on the package; the impact
should be minimal since most environments will already be installing it.
@jakelishman jakelishman added type: qa Issues and PRs that relate to testing and code quality Changelog: None Do not include in changelog labels Jan 4, 2024
@jakelishman jakelishman requested a review from a team as a code owner January 4, 2024 12:48
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7409704885

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 87.559%

Totals Coverage Status
Change from base Build 7400961847: 0.02%
Covered Lines: 59317
Relevant Lines: 67745

💛 - Coveralls

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cryoris Cryoris enabled auto-merge January 4, 2024 15:15
@Cryoris Cryoris added this pull request to the merge queue Jan 4, 2024
@wshanks wshanks mentioned this pull request Jan 4, 2024
Merged via the queue into Qiskit:main with commit c14ed3d Jan 4, 2024
13 checks passed
@jakelishman jakelishman deleted the typing-extensions branch January 4, 2024 17:04
ShellyGarion pushed a commit to ShellyGarion/qiskit-terra that referenced this pull request Jan 18, 2024
The extent of our use of `typing_extensions` has fluctuated over time,
but we've often had a dependency on it.  This is typically not an
onerous dependency, being pure Python, and is not uncommon for other
packages.

We've often had an upper limit on the Python version for it, just for
the principle of least requirements, but this has led to a subtle bug
recently where we began using a Python 3.12 feature from it (`Unpack`)
with the requirement left at `python_version<'3.11'` from before.  This
was caught by our nightly full test suite, but for unrelated reasons,
that's not commenting correctly on issues at the moment.  This error is
quite likely to repeat; we only use the backport package for Python
versions that _aren't_ the newest, but our PR CI tests only oldest and
newest.

This commit simply lifts the upper limit on the package; the impact
should be minimal since most environments will already be installing it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants