Skip to content

chore: pin deps to SHA256 hashes via pip-compile#4268

Merged
vvbandeira merged 9 commits into
The-OpenROAD-Project:masterfrom
luarss:topic/pin-deps-orfs
Jun 6, 2026
Merged

chore: pin deps to SHA256 hashes via pip-compile#4268
vvbandeira merged 9 commits into
The-OpenROAD-Project:masterfrom
luarss:topic/pin-deps-orfs

Conversation

@luarss
Copy link
Copy Markdown
Contributor

@luarss luarss commented May 30, 2026

fixes #4263

Summary

Pin all Python dependencies to SHA256 hashes using pip-compile --generate-hashes from pip-tools. This mirrors the pattern already in place for flow/util/requirements_lock.txt and extends it to every other pip install location in the repo.

Changes

Area Before After
docs/ requirements.txt (all unpinned) requirements.in + requirements_lock.txt (SHA256-pinned)
GitHub Actions (3 workflows) per-workflow inline pip install (partially/fully unpinned) single .github/requirements/requirements_lock.txt shared by all
etc/DependencyInstaller.sh 6 packages installed unpinned etc/requirements-common.in + requirements-common_lock.txt

Details

  • Each area gets a *.in source file (high-level constraints) and a generated *_lock.txt with full SHA256 hashes for every package including transitive deps.
  • docs/requirements.txtdocs/requirements.in: the git+https:// URL for sphinx-external-toc is replaced with sphinx-external-toc==0.3.1 (same release, available on PyPI, hash-verifiable).
  • .readthedocs.yaml: Python bumped from 3.7 (EOL) to 3.10; install target updated to docs/requirements_lock.txt.
  • All three CI workflows (lint-tcl, yaml-test, update-rules) now share .github/requirements/requirements.in and a single lock file. Workflows that had no explicit Python version now pin to 3.10 via actions/setup-python, consistent with update-rules.
  • Lock files are regenerated with: pip-compile --generate-hashes <file>.in -o <file>_lock.txt

@luarss luarss requested a review from vvbandeira May 30, 2026 06:34
Copy link
Copy Markdown
Contributor

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

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 introduces lockfiles for managing Python dependencies across various configurations, including GitHub workflows, ReadtheDocs, and the dependency installer script, while also upgrading the Python build version to 3.10 on ReadtheDocs. Feedback on the changes highlights a portability issue in DependencyInstaller.sh, where the use of realpath may fail on macOS, and suggests a more robust alternative using cd and pwd.

Comment thread etc/DependencyInstaller.sh Outdated
@luarss luarss force-pushed the topic/pin-deps-orfs branch 3 times, most recently from 2406b27 to 078c489 Compare May 30, 2026 07:22
@vvbandeira vvbandeira enabled auto-merge June 5, 2026 18:42
@vvbandeira
Copy link
Copy Markdown
Member

@luarss CI is failing with:

ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/tmp/installer/requirements-common_lock.txt'

auto-merge was automatically disabled June 6, 2026 02:58

Head branch was pushed to by a user without write access

luarss and others added 9 commits June 6, 2026 03:30
Replace unpinned docs/requirements.txt with a requirements.in source
spec and a pip-compile-generated requirements_lock.txt with SHA256
hashes for all packages. Switch sphinx-external-toc from a git URL to
its PyPI release so hashes can be verified. Update .readthedocs.yaml
to use the lock file and bump Python from 3.7 (EOL) to 3.10.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
Add .github/requirements/tclint.in and a pip-compile-generated lock
file with SHA256 hashes. Update the lint-tcl workflow to install from
the lock file and pin Python to 3.10 via actions/setup-python.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
Add .github/requirements/yaml-test.in and a pip-compile-generated lock
file with SHA256 hashes. Update the yaml-test workflow to install from
the lock file, add the lock file to sparse-checkout, and pin Python to
3.10 via actions/setup-python. Also pins the previously unpinned pyyaml.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
Add .github/requirements/update-rules.in and a pip-compile-generated
lock file with SHA256 hashes. Update the update-rules workflow to
install from the lock file instead of unpinned firebase-admin.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
Add etc/requirements-common.in and a pip-compile-generated lock file
with SHA256 hashes for all packages previously installed unpinned
(pandas, numpy, firebase_admin, click, pyyaml, yamlfix). Update
_installPipCommon() to install from the lock file.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
Merge the three per-workflow requirements files (tclint, yaml-test,
update-rules) into a single .github/requirements/requirements.in and
a shared requirements_lock.txt. All CI workflows now install from one
place, reducing lock-file sprawl and making dependency updates a
single-file change.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
DependencyInstaller.sh resolves the pip lockfile relative to its own
directory, so requirements-common_lock.txt must be copied alongside it
into /tmp/installer/etc/ inside the container.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Vitor Bandeira <vvbandeira@users.noreply.github.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
Capture _script_dir as the script's absolute directory before the
top-level cd, so _installPipCommon finds requirements-common_lock.txt
at the script's location rather than the post-cd working directory.

Signed-off-by: Jack Luar <jluar@precisioninno.com>
@luarss luarss force-pushed the topic/pin-deps-orfs branch from 70ca636 to 83e9302 Compare June 6, 2026 03:30
@vvbandeira vvbandeira merged commit 85d92b5 into The-OpenROAD-Project:master Jun 6, 2026
8 checks passed
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.

pin python requirements to sha

2 participants