Skip to content

Automatically discover package requirements from extra-requirements.txt files - #497

Merged
mhucka merged 5 commits into
quantumlib:mainfrom
LestlinRobins:fix/automatic-requirements-discovery
Oct 15, 2026
Merged

mhucka merged 5 commits into
quantumlib:mainfrom
LestlinRobins:fix/automatic-requirements-discovery

Conversation

@LestlinRobins

@LestlinRobins LestlinRobins commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #451

Automatically discovers package-level extra-requirements.txt files in both dev_tools/write-ci-requirements.py and setup.py, removing the need to maintain hard-coded package lists.

Changes

  • Uses pathlib.Path.glob() to discover requirements files.
  • Derives each extra's name from its parent directory.
  • Preserves the existing QAOA-specific handling for the next Cirq version.

@google-cla

google-cla Bot commented Oct 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@LestlinRobins

Copy link
Copy Markdown
Contributor Author

I looked into the CI failure. It appears to be crashing during pytest collection, with workers terminating due to a Fatal Python error: Illegal instruction in fqe.lib.fqe_data, before any tests run.

This seems separate from the requirements-discovery changes in this PR. Could you confirm whether this is a known CI/environment issue?

@mhucka

mhucka commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

I looked into the CI failure. It appears to be crashing during pytest collection, with workers terminating due to a Fatal Python error: Illegal instruction in fqe.lib.fqe_data, before any tests run.

This seems separate from the requirements-discovery changes in this PR. Could you confirm whether this is a known CI/environment issue?

You're right. Sometimes the GitHub runners flake out, possibly due to the worsening strain on their infrastructure. Rerunning the CI jobs is necessary in those cases.

If you suspect this in the future, you should be able to cause the CI to rerun by pushing an empty commit:

git commit --allow-empty -m "Trigger CI"
git push origin <your-branch-name>

@mhucka mhucka self-assigned this Oct 13, 2026

@mhucka mhucka left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR is close to being ready. A couple of change requests (plus see the inline comment):

  1. Add the following to MANIFEST.in:

    recursive-include recirq extra-requirements.txt
  2. Reduce the PR description. The obviously LLM-generated stuff is mostly useless. The first 2 sentences are enough.

Comment thread setup.py Outdated
@LestlinRobins
LestlinRobins requested a review from mhucka October 14, 2026 06:25
@LestlinRobins

Copy link
Copy Markdown
Contributor Author

Hi @mhucka, all CI checks are now passing, and I've also addressed the changes you suggested. Whenever you're available, could you please review and merge the PR? Thanks!

@mhucka mhucka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks again.

@LestlinRobins

Copy link
Copy Markdown
Contributor Author

Thanks for approving, @mhucka, could you please merge this as well?

@mhucka
mhucka added this pull request to the merge queue Oct 15, 2026
Merged via the queue into quantumlib:main with commit 93d6fe5 Oct 15, 2026
15 checks passed
@LestlinRobins

Copy link
Copy Markdown
Contributor Author

Thank you @mhucka :)

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.

Make adding requirements for new packages more intuitive

2 participants