Skip to content
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

Build: don't pre-install pip and setuptools in images #10834

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Oct 17, 2023

We hit a problem with Python 3.12 and the outdated version of pip that we have pre-installed.

Python ships with a vendored version of pip,
and we install the latest version of pip and setuptools on each build before installing the requirements.

The only breaking change here would be for projects using build.commands, setuptools won't be available anymore, pip is vendored by Python, so that shouldn't be a problem. I think we are fine not installing setuptools,
build.commands is in beta, so we can get away with this :)

Fixes #10832

We may even consider not installing virtualenv on python3.x and just use venv.

We hit a problem with Python 3.12 and the outdated version of pip
that we have pre-installed.

Python ships with a vendored version of pip,
and we install the latest version of pip and setuptools on each build
before installing the requirements.

The only breaking change here would be for projects using
build.commands, setuptools won't be available anymore,
pip is vendored by Python, so that shouldn't be a problem.
I think we are fine not installing setuptools,
build.commands is in beta, so we can get away with this :)

Fixes #10832
@stsewd stsewd requested a review from a team as a code owner October 17, 2023 22:09
@stsewd stsewd requested a review from ericholscher October 17, 2023 22:09
@stsewd stsewd requested a review from humitos October 17, 2023 22:09
@humitos
Copy link
Member

humitos commented Oct 18, 2023

The only breaking change here would be for projects using build.commands, setuptools won't be available anymore, pip is vendored by Python, so that shouldn't be a problem.

I'm fine with this. I'm happy we are continuing moving away from having pre-installed dependencies 😄

@humitos
Copy link
Member

humitos commented Oct 18, 2023

We may even consider not installing virtualenv on python3.x and just use venv.

I think we found some differences when doing this in the past, but I'm not 100% sure. However, we will eventually hit the same problem since we are pinning to a particular version and at some point, the newer Python won't support it 😄

@humitos
Copy link
Member

humitos commented Oct 18, 2023

Note that once we merge this PR, we will need to re-trigger the CircleCI job that compiles and re-upload all the supported versions to S3.

@humitos humitos merged commit 1c40217 into main Oct 18, 2023
2 checks passed
@humitos humitos deleted the dont-install-pip-setuptools branch October 18, 2023 12:11
@humitos
Copy link
Member

humitos commented Oct 18, 2023

It seems it's working. I'm seeing lines like

+ docker exec 2ee731c018bc1eed7669dfaceb44c8f92699fbd18893a19bc8b5893e771f03d9 python -m pip install -U virtualenv==20.7.2

that only install virtualenv and not setuptools or pip.

stsewd added a commit that referenced this pull request Oct 18, 2023
#10834 didn't solve
#10832.

Having an outdated version of pip is still the main problem,
but the outdated version of pip didn't come from the python installation, but from the virtualenv creation.

When creating the environment, virtualenv installs some specfic/outdated versions of pip/setuptools/wheels.

https://github.com/pypa/virtualenv/blob/20.7.2/src/virtualenv/seed/wheels/embed/__init__.py
stsewd added a commit that referenced this pull request Oct 18, 2023
#10834 didn't solve
#10832.

Having an outdated version of pip is still the main problem,
but the outdated version of pip didn't come from the python installation, but from the virtualenv creation.

When creating the environment, virtualenv installs some specfic/outdated versions of pip/setuptools/wheels.

https://github.com/pypa/virtualenv/blob/20.7.2/src/virtualenv/seed/wheels/embed/__init__.py
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.

Build under Python 3.12 fails on pip upgrade step
2 participants