-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force PIP not to upgrade any Debian-installed Python packages. #1126
Conversation
This PR amends the `update-constraints.sh` script to automatically extract from the filesystem the list of Python packages that have already been installed by Debian, and that PIP should not attempt to upgrade to any later version. In addition to the normal `constraints.txt` file, it generates an additional `pip-constraints.txt` file, to be used to force PIP not to do anything with the system-managed packages. This has the side-effect of ensuring that we never upgrade to any version of setuptools more recent than 72 (known to cause issues with some packages needed by the ODK), since the version provided by Debian is 68.1.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didnt review this line but for the rest it looks good!
If the build passes the first 1 minute, maybe its fine.
The $ ls /usr/lib/python3/dist-packages
__pycache__ gyp-0.1.egg-info psycopg2 six-1.16.0.egg-info
_distutils_hack pip psycopg2-2.9.9.egg-info six.py
distutils-precedence.pth pip-24.0.dist-info setuptools wheel
gyp pkg_resources setuptools-68.1.2.egg-info wheel-0.42.0.dist-info where what is of interest for us are the |
Thank you for the clarification! |
Of note, with the approach used in this PR we may run into two problems in the future: (A) A build may break if Debian/Ubuntu updates ones of the Python packages whose version is fixed in Presumably this should rarely happen, if ever. Once a Debian version has been released, the only package updates are normally security-related updates, and it’s probably unlikely that packages such as If/when that happens, we will need to update the (B) We will run into a much bigger problem the next time we upgrade the base image (say, when we upgrade to Ubuntun 26.04), if by then the Ubuntu package for |
Sounds horrible, but maybe warrants a comment right there in the code as well? |
For (A), I am thinking about updating again both the Dockerfile and the The idea is: (1) Add a (2) In the Dockerfile, check the list of Ubuntu-installed Python packages, and if differs from the As for (B), I don’t even want to think about it. When that happens (and it will happen eventually: if not with Ubuntu 26.04 then with Ubuntu 28.04), we will be screwed anyway. Most likely the only solution at the time will be to isolate the Python packages that are still broken with |
This PR amends the
update-constraints.sh
script to automatically extract from the filesystem the list of Python packages that have already been installed by Debian, and that PIP should not attempt to upgrade to any later version.In addition to the normal
constraints.txt
file, it generates an additionalpip-constraints.txt
file, to be used to force PIP not to do anything with the system-managed packages.This has the side-effect of ensuring that we never upgrade to any version of setuptools more recent than 72 (known to cause issues with some packages needed by the ODK), since the version provided by Debian is 68.1.2.