Skip to content

Conversation

mhucka
Copy link
Member

@mhucka mhucka commented Aug 28, 2025

The Python typing package changed in at least one respect between Python 3.10 and 3.11: in 3.10, it did not have the symbol Self). Cirq 1.6+ assumes that the Self is defined by importing typing, and fails in Python 3.10. This leads to the error seen in the CI runs

https://github.com/tensorflow/quantum/actions/runs/17288698138/job/49070859286

ImportError: cannot import name 'Self' from 'typing'

Since Cirq 1.6 requires Python 3.11 anyway, this workflow (for testing against the Cirq pre-release) should probably use 3.11. Doing so avoids the problem.

An additional change in this PR is to make this workflow trigger on pushes that affect this workflow file, so that the results of edits to the workflow can be seen immediately during development.

The Python `typing` package changed in at least one respect between
Python 3.10 and 3.11: in 3.10, it did not have the symbol `Self`). Cirq
1.6+ assumes that the `Self` is defined by importing `typing`, and fails
in Python 3.10. This leads to the error seen in the CI runs

https://github.com/tensorflow/quantum/actions/runs/17288698138/job/49070859286

```
ImportError: cannot import name 'Self' from 'typing'
```
@mhucka mhucka marked this pull request as ready for review August 28, 2025 23:06
This workflow doesn't get triggered as a CI check. When making changes,
unless we invoke it manually, you will not see the effects of the
changes until the next run. For developer convenience, let's run it on
pushes that change this file.
@mhucka mhucka changed the title Need to use at least Python 3.11 for Cirq 1.6+ Fix #884: use Python 3.11 in nightly Cirq pre-release compatibility test Aug 28, 2025
@mhucka
Copy link
Member Author

mhucka commented Aug 28, 2025

Note: because this workflow is purposefully not triggered as a CI check, the results of checks on this PR don't include this workflow itself. The output can be seen instead in my fork: https://github.com/mhucka/quantum/actions/runs/17310238898/job/49142715557

@mhucka mhucka added the area/ci Involves continuous integration workflows and infrastructure label Aug 28, 2025
@mhucka mhucka marked this pull request as draft August 29, 2025 13:49
@mhucka
Copy link
Member Author

mhucka commented Aug 29, 2025

Reverting this back to a draft. Using 3.11 causes at least one compatibility problem that must be resolved first.

@mhucka mhucka closed this Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci Involves continuous integration workflows and infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant