-
Notifications
You must be signed in to change notification settings - Fork 126
CI Testing Matrix #237
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
CI Testing Matrix #237
Conversation
875435c
to
25fe81b
Compare
rebased off of #241 |
Change-Id: Ie459837e01de2283a59a89a5d1804d33d954c653
25fe81b
to
c218240
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! One step towards a better ecosystem!
'previous': '==0.12.0', | ||
'current': '==0.13.0', | ||
'next': '>=0.14.0.dev', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put a note in the requirements.txt file so that people know to go and update this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, done
from pytket.predicates import CompilationUnit, ConnectivityPredicate | ||
from pytket.routing import GraphPlacement | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a quick comment here to explain that this is here for CI tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added:
# Set the 'RECIRQ_IGNORE_PYTKET' environment variable to treat PyTket as an optional
# dependency. We do this for CI testing against the next, pre-release Cirq version.
(in general, users could also set this environment variable if they get themselves into hot water managing the pytket dependency)
Change-Id: I1fde0b2d8d621bfcd1c43f503c4b87b8df789c58
Change-Id: I76f5ef0e1c6401760aeb61412dd846b1e10a0fc9
I modified the |
Problem overview
We depend on openfermion, pytket, and pytket-cirq; which have historically been over-pinned to a particular cirq version. "Overpinned" means that even if it seems to work with a newer (or older!) cirq version, the
install_requires
still specifies one version.pip
has recently (past year) learned to be strict about satisfying requirements.pip
will end up in an infinite loop downloading old versions instead of saying which package is causing a version deadlockAs a developer, I can get things to work by installing dependencies myself and then
pip install --no-deps
openfermion, cirq, pytket, or recirq so pip can't get in my way.However, one important use case is supporting colab which must have a simple install script; hopefully just
pip install recirq
(or, specifically, the git url).Openfermion relaxation
Cirq has been generally stable across the past couple of releases, especially if one were to go through and fix deprecation warnings. Indeed, I have changed openfermion quantumlib/OpenFermion#755 to not pin in
install_requires
but to use the CI to test against multiple versions of Cirq.Towards relaxing ReCirq
This PR aims to head towards the same goal. We test against the previous, current, and next version of Cirq. Testing against the next version of Cirq is particularly important when committing code that depends on unreleased Cirq features. The trick is to attempt the full matrix of versions, and lean heavily on
pytest.mark.skipif
to make sure tests only run under supported configurations.In particular, we introduce a script to capture the intricacies of the various test configurations:
write-ci-requirements.txt
. This lets us pin to a particular cirq version during CI testing but not ininstall_requires
, which we change to a lower bound.This script has several notable features
Cirq 0.13
This fixes #224 because pytket and openfermion have compatible versions now.
Cirq 0.14
We'll now be in the regime where we need to fix ReCirq for the next Cirq version before it is released. As such, this PR is based off of #241 .
Per-package testing
This still tests the whole ReCirq repository at once. We can modify
write-ci-requirements.py
to help simplify a new matrix job that tests each subpackage in isolation.skipif
may be a large component to that as well.