Repository navigation
DependencyInstaller: the Python lock in a virtual environment on Ubuntu 23.04+ - #4787
Conversation
…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>
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
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.
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
On Ubuntu 23.04 and later the system Python is externally managed (PEP 668), and
etc/DependencyInstaller.shtakes Python packages from apt only:etc/requirements-common_lock.txtis 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;The change
_installPipCommoninstalls the lock into the virtual environment thatVIRTUAL_ENVnames, on any OS, and creates it if it does not exist yet.docker/Dockerfile.devnames one,/opt/orfs-python, and puts it first onPATH, sopython3, and with itPYTHON_EXE, is its interpreter in the dev and builder images.VIRTUAL_ENV, nothing changes: the apt packages, and-commonsays how to get the rest.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.04andubuntu:26.04containers,_installPipCommonfrom this branch withVIRTUAL_ENV=/opt/orfs-python, then the venv first onPATH:python3import pandas, numpy, click, yaml, yamlfix, google.cloud.pubsub/opt/orfs-python/bin/python3/opt/orfs-python/bin/python3Dockerfile.devis 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