Repository navigation
Conversation
e57b68d to
6d2673b
Compare
|
@tamird review |
what am I reviewing? |
|
@tamird review this PR |
|
But why? Konsti works at OAI and is a core contributor to uv. |
|
@tamird because you provide valuable feedback, and I'm uncertain if someone being an OAI employee means they know how a bazel change will effect your full build/CI? |
|
One compatibility case this doesnβt cover: setuptools/distutils checks its venv ignore list before normalizing option names, so underscore-form Separately, this changes the observable virtualenv layout: |
|
Please checkout the failing test.
Since we are still in v2 alpha maybe we can remove those entirely, how does it effect the tests? Do we know how common this is though? @xangcastle |
|
I believe the |
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
6d2673b to
f513b1f
Compare
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: β Files ignored due to path filters (1)
π Files selected for processing (25)
π€ Files with no reviewable changes (1)
π WalkthroughWalkthroughThe venv generator now configures ChangesVirtual environment startup behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: π΅ Low Β· up to On Python 3.10+, direct legacy setup.py installs may no longer be prevented from placing files outside the venv when underscore-form install settings are used. This is a documented, unsupported workflow, but it remains a bounded compatibility risk that should have explicit owner acceptance or targeted test coverage. Suggested reviewers: π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
β¨ Finishing Touches π‘ 1π οΈ Fix failing CI checks π‘
π§ͺ Generate unit tests (beta)
Comment |
Fix references the shim-gating commit missed: tests asserting the shim is loaded, say.py using it as a path anchor, the venv tree snapshot (regenerated at the 3.13 default), venv .pth snapshots gaining the PATH line, and the oci layer listings still containing shim entries.
f513b1f to
6a0db53
Compare
Assert a 3.9 venv loads the shim at startup, materializes it as a real file, and that its distutils patch clamps [install] prefix and strips underscore-form keys the built-in venv guard misses.
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
Python 3.9 venvs keep the shim.
Python 3.10+ targets:
_virtualenv.py/_virtualenv.pthare no longer created, and the venv bin/ PATH setup moved into the main<name>.pth._virtualenvdirectly (e.g. as a path anchor) must use another anchor such as sys.prefix.setup.pyinstall into a built venv with underscore-form[install]keys (install_purelib, β¦) is no longer stripped and can install outside the venv. Installing into a built venv at runtime is not a supported rules_py workflow.Test plan