perf(venv): skip the distutils shim on Python 3.10+#1358
Open
konsti-openai wants to merge 1 commit into
Open
Conversation
Stop materializing and importing the virtualenv distutils shim for Python 3.10+, where pip and setuptools already ignore the affected install configuration. Keep the shim for Python 3.9 and move the rules_py-specific PATH setup into the existing venv .pth so console scripts remain discoverable. Match the upstream changes: pypa/virtualenv#3184 astral-sh/uv#20222
konsti-openai
force-pushed
the
konsti/remove-virtualenv-distutils-shim
branch
from
July 20, 2026 22:21
e57b68d to
6d2673b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a port of pypa/virtualenv#3184 and astral-sh/uv#20222, which removed the distutils hack recently. Removing this brings venv creation in line with virtualenv and uv again and improves Python startup perf.
This is the conservative version of this change. The workaround is only required in an obscure setup where you have the bogus ancient configuration file in the current directory when performing operations. If we can safely assume that bazel users don't do that, we can remove the two files entirely.
Changes are visible to end-users: yes/no
Test plan