Skip to content

Replace pip-compile-based dependency management with uv-based approach#1352

Merged
mhucka merged 24 commits into
quantumlib:mainfrom
mhucka:use-uv
Jun 11, 2026
Merged

Replace pip-compile-based dependency management with uv-based approach#1352
mhucka merged 24 commits into
quantumlib:mainfrom
mhucka:use-uv

Conversation

@mhucka

@mhucka mhucka commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Replace the Docker file and scripts in dev_tools/requirements with a simpler scheme that uses uv. Among other things, uv's smarter method for producing lock files makes it possible to deal with Cirq version interactions with Python's versions, so that users can use the latest Cirq version if they are also using recent Python versions.

@mhucka

mhucka commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the dependency compilation process from a Docker-based pip-compile setup to a local bash script utilizing uv. It updates the dependency files with Python version markers, regenerates the environment files with hashes, and configures uv in pyproject.toml. The review feedback highlights two key issues: the getopts parser in the new bash script will incorrectly swallow options intended for uv, and a critical lower bound constraint for cirq-core was omitted for Python versions older than 3.11.

Comment thread dev_tools/requirements/create-env-files.sh Outdated
Comment thread dev_tools/requirements/deps/runtime.txt Outdated
mhucka and others added 3 commits June 8, 2026 22:14
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@mhucka
mhucka marked this pull request as ready for review June 9, 2026 05:24
@mhucka
mhucka requested a review from pavoljuhas June 9, 2026 05:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the previous Docker-based pip-compile workflow with a faster, uv-based dependency compilation process. It introduces a new script, dev_tools/requirements/create-env-files.sh, updates dependency requirements with environment markers, regenerates the environment lock files with hashes, and configures uv in pyproject.toml. Feedback on the changes highlights a potential Shellcheck warning (SC2086) in the new shell script due to unquoted variables, with a recommendation to use a Bash array to safely handle optional arguments.

Comment thread dev_tools/requirements/create-env-files.sh Outdated
Comment thread dev_tools/requirements/create-env-files.sh Outdated

@pavoljuhas pavoljuhas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please see inline comments regarding max_compat files, otherwise LGTM.

Also, if all .env.txt files will be only generated by the uv, consider marking them up with the linguist-generated git attribute like here (can be a separate PR).

Comment thread dev_tools/requirements/create-env-files.sh Outdated
Comment thread dev_tools/requirements/create-env-files.sh Outdated
Comment thread dev_tools/requirements/create-env-files.sh
Comment thread dev_tools/requirements/deps/oldest-versions.txt Outdated
Comment thread dev_tools/requirements/deps/runtime.txt
@mhucka

mhucka commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Also, if all .env.txt files will be only generated by the uv, consider marking them up with the linguist-generated git attribute like here (can be a separate PR).

Thanks for the great idea. Done in PR #1355

@mhucka
mhucka requested a review from pavoljuhas June 10, 2026 21:00
@mhucka mhucka added the area/devops Involves build systems, Make files, Bazel files, continuous integration, and or other DevOps topics label Jun 10, 2026
Comment thread dev_tools/requirements/create-env-files.sh Outdated

@pavoljuhas pavoljuhas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, please see one last suggestion before merging.

Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com>
@mhucka
mhucka added this pull request to the merge queue Jun 11, 2026
Merged via the queue into quantumlib:main with commit 793844f Jun 11, 2026
22 checks passed
@mhucka

mhucka commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

Resolved by #1340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/devops Involves build systems, Make files, Bazel files, continuous integration, and or other DevOps topics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants