Skip to content

Use pip-compile to pin ReCirq requirements. #137

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

Closed

Conversation

PawelPamula
Copy link
Contributor

Pinning the requirements required fixing versions of the following
packages: pytket-cirq==0.3 and pytket=0.5.2 due to the latest pytket
relying on openfermion~=0.11 and hfvqe relying on openfermion~=1.0.0.

Also the following requirements were added:

  • pytest (for efficient test suite running)
  • numpy (used in various tests but wasn't explicitly required)
  • pip-compile (for automated requirements generation)

Pinning the requirements required fixing versions of the following
packages: pytket-cirq==0.3 and pytket=0.5.2 due to the latest pytket
relying on openfermion~=0.11 and hfvqe relying on openfermion~=1.0.0.

Also the following requirements were added:
+ pytest (for efficient test suite running)
+ numpy (used in various tests but wasn't explicitly required)
+ pip-compile (for automated requirements generation)
@PawelPamula
Copy link
Contributor Author

I'm happy to discuss options other than downgrading pytket library.

@dstrain115
Copy link
Collaborator

Adding Matt Harrigan, since this affects more than just quantum chess. Can you look over the requirements changes?

I will be happy if this finally fixes the annoying tket issue, but I thought that had to be fixed upstream.

@mpharrigan
Copy link
Collaborator

Can you elaborate on what's currently broken? The CI seems to be installing the current requirements just fine

@dstrain115
Copy link
Collaborator

Matt, there is a tket warning whenever you install recirq.

ERROR: pytket 0.7.0 has requirement openfermion~=0.11, but you'll have openfermion 1.0.0 which is incompatible.
ERROR: pytket 0.7.0 has requirement sympy~=1.6, but you'll have sympy 1.1.1 which is incompatible.

However, I think that this PR is mainly just clean-up and bolstering the requirement.txt file by using pip-compile. Sending it your way, since this changes how the requirements.txt is generated. Maybe Pawel can elaborate more on the advantages of this clean-up.

@mpharrigan
Copy link
Collaborator

mpharrigan commented Feb 2, 2021

Yes, I've done some digging and it does indeed look like pytket pins to openfermion 0.11, which is pretty insane. The pip resolver will go back and install pytket-cirq 0.3 and pytket 0.5.2 although I didn't get a warning. Are you using the latest pip?

Pinning to these older versions is a bandaid, but I can't imagine that the older version of the package is more forwards-compatible to openfermion than the new one. We should open an issue with the pytket folks in any event.

If we use pip-compile:

  1. we have to re-engineer the install_requires part of setup.py which currently reads from requirements.txt. I don't want to be setting the install-requires to highly pinned packages, see pytket problems for reference on why this is a bad thing
  2. Consider introducing this to Cirq as well, as I'd like to keep in sync with how they manage dependencies. That's why I'm doing the requirements.txt parsing against my will (they do it that way).
  3. We need a schedule or some sort of automation for updating the pins periodically, or we will be testing against outdated packages.

@mpharrigan
Copy link
Collaborator

xref CQCL/pytket-docs#39

pytket==0.5.2

# quantum chess, only needed for tests
scipy
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can put this up in the top group of "general numeric python requirements". Along with numpy (and pandas and matplotlib) it's (or at least it was) assumed to get roped in from cirq

@mpharrigan
Copy link
Collaborator

FWIW they fixed the latest pytket release to not have an incompatible openfermion dependency

@mpharrigan
Copy link
Collaborator

I've pinned pytket "the old fashioned way" in #148 (which had some other issues too). I'm interested in pip-compile but I think it would be more impactful in Cirq

@mpharrigan
Copy link
Collaborator

closing following #237

@mpharrigan mpharrigan closed this Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants