Skip to content

DependencyInstaller: the Python lock in a virtual environment on Ubuntu 23.04+ - #4787

Merged
vvbandeira merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:python-lock-everywhere
Nov 4, 2026
Merged

vvbandeira merged 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:python-lock-everywhere

Conversation

@oharboe

@oharboe oharboe commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

On Ubuntu 23.04 and later the system Python is externally managed (PEP 668), and etc/DependencyInstaller.sh takes Python packages from apt only: etc/requirements-common_lock.txt is never installed there. Ubuntu 24.04 and 26.04 are what the Docker images and CI run, so in them:

  • google-cloud-pubsub, in the lock and not in apt, is missing;
  • pandas, numpy, click, pyyaml and yamlfix come at apt's versions, not the lock's.

The change

  • _installPipCommon installs the lock into the virtual environment that VIRTUAL_ENV names, on any OS, and creates it if it does not exist yet.
  • docker/Dockerfile.dev names one, /opt/orfs-python, and puts it first on PATH, so python3, and with it PYTHON_EXE, is its interpreter in the dev and builder images.
  • On Ubuntu 23.04+ without VIRTUAL_ENV, nothing changes: the apt packages, and -common says how to get the rest.
  • macOS already required a virtual environment, and now goes through the same lines.

This is the way in for a Python module apt does not carry: add it to the lock. #4757 (KLayout's Python module for the GDS merge) waits for this.

Test

In ubuntu:24.04 and ubuntu:26.04 containers, _installPipCommon from this branch with VIRTUAL_ENV=/opt/orfs-python, then the venv first on PATH:

Python python3 import pandas, numpy, click, yaml, yamlfix, google.cloud.pubsub
ubuntu:24.04 3.12.3 /opt/orfs-python/bin/python3 ok
ubuntu:26.04 3.14.4 /opt/orfs-python/bin/python3 ok

Dockerfile.dev is an input of the dev image's tag, so CI on this PR builds a new dev image from it and runs the flows on it.

🤖 Generated with Claude Code

…tu 23.04+

On Ubuntu 23.04 and later the system Python is externally managed (PEP
668), and the installer took Python packages from apt only:
etc/requirements-common_lock.txt was never installed there. Ubuntu 24.04
and 26.04 are what the Docker images and CI run, so google-cloud-pubsub,
which apt does not carry, was missing in them, and the other packages
came at apt's versions, not the lock's.

_installPipCommon installs the lock into the virtual environment
VIRTUAL_ENV names, on any OS, and creates it if it does not exist. The
dev image names one, /opt/orfs-python, and puts it first on PATH, so
python3 and PYTHON_EXE are its interpreter in the images. Without
VIRTUAL_ENV, Ubuntu 23.04+ keeps the apt packages, as before, and -common
says how to get the rest. macOS already required a virtual environment;
it now goes through the same lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@oharboe

oharboe commented Nov 4, 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 configures a Python virtual environment in the development Dockerfile and updates the dependency installer script (DependencyInstaller.sh) to support installing Python dependencies into a virtual environment. This change addresses PEP 668, where the system Python is externally managed. Specifically, it sets up VIRTUAL_ENV in the Dockerfile and modifies DependencyInstaller.sh to create and install packages into the virtual environment when VIRTUAL_ENV is defined, or prompt the user to set it when running on systems with an externally managed Python. There are no review comments, so I have no feedback to provide.

@openroad-ci

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit 273dcfc · Jenkins build #1 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

@vvbandeira
vvbandeira merged commit 43f9927 into The-OpenROAD-Project:master Nov 4, 2026
12 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.

3 participants