-
Notifications
You must be signed in to change notification settings - Fork 1
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
python 3.12, setuptools and venv #54
Conversation
~~Hm this doesn't look good. It seems like the appenv environment depends on the executing python version due to the unconditional With newer python versions, creating a new venv doesn't include setuptools anymore, but batou requires setuptools and complains.~~ The correct choice is not to modify the pip freeze call, but instead install setuptools |
8edf949
to
ee26e52
Compare
Ah, I know what we need: #1 The update command needs to migrate the project for 3.12 by reinstalling the required packages and updating the lockfile based on that. In the end, the new lockfiles include an explicit setuptools dependency. The upgrade path is also handled and no erroneous project state is introduced |
…o ensure_best (all runs)
ee26e52
to
889fd94
Compare
Since python/cpython#95299 we need to ensure we have a setuptools ourselves.
They changed
pip freeze
behaviour in python 3.12 too: pypa/pip#12032This leaves us with 2 options:We could lock all dependencies withpip freeze --all
but:this would also lockpip
,wheel
to a specific version, which is a change in behaviourwe would need to update therequirements.lock
to update the version ofpip
usedWe could forbid projects with mixed python >= 3.12 and < 3.12 versions in theirappenv-python-preference
listthis would prevent the issue from happening in the first placewe would need to inform users about this changeTo understand the second option better, it is important to know thatbatou
only uses the first python version in theappenv-python-preference
list that is actually installed on the system.This means that if you have3.12,3.11
as yourappenv-python-preference
and3.12
is installed,batou
will use3.11
for lockfile preparation and3.12
for venv creation. The resulting lockfile will not containsetuptools
andpip freeze
will not showsetuptools
either. This lockfile is incompatible with python 3.12, and once a user without3.12
installed tries to create a venv, they will run into the issue described above.Also, if you have3.12,3.11
as yourappenv-python-preference
and3.11
is installed,batou
will use3.11
for lockfile preparation and3.11
for venv creation. The resulting lockfile will not containsetuptools
andpip freeze
will not showsetuptools
either. This does not immediately cause an issue, but once a user with3.12
installed tries to create a venv, they will run into the issue described above.This PR does
pip freeze --all --exclude pip
if both python >= 3.12 and < 3.12 are in theappenv-python-preference
list. This mimics the behaviour ofpip freeze
after the change in python 3.12.