Skip to content

Conversation

@arrdem
Copy link
Collaborator

@arrdem arrdem commented Nov 7, 2025

Python has an -E flag, which causes it to ignore PYTHONHOME and PYTHONEXECUTABLE both of which are key to how we're making the shim work.

Add a flag parser to the shim so we process the argv and strip out -E if it's set, and if -I is set we translate it to its equivalent -E and -s, and drop the -E.

Add Rust tests covering some basic cases for the parser so we aren't integration testing that.

Update Clap.

Go back to unwind rather than abort as our error handling strategy as it's required for writing tests and clap.

Fixes #703.

Changes are visible to end-users: no

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes

py_venv will now unset the -E interpreter flag with which it's incompatible. -I is translated to -s.

Test plan

  • Covered by existing test cases
  • New test cases added

arrdem and others added 3 commits November 7, 2025 12:44
Python has an `-E` flag, which causes it to ignore PYTHONHOME and
PYTHONEXECUTABLE both of which are key to how we're making the shim
work.

Add a flag parser to the shim so we process the argv and strip out -E if
it's set, and if -I is set we translate it to its equivalent -E and -s,
and drop the -E.

Add Rust tests covering some basic cases for the parser so we aren't
integration testing that.

Update Clap.

Go back to unwind rather than abort as our error handling strategy as
it's required for writing tests and clap.
@aspect-workflows
Copy link

aspect-workflows bot commented Nov 7, 2025

test-os:linux-bzl:8 (Test)

⚠️ Buildkite build #999 is currently failing.

@@+uv+sbuild__pypi__default__bravado_core//:whl failed to build

python3 failed: error executing Action command (from target @@+uv+sbuild__pypi__default__bravado_core//:whl) bazel-out/k8-fastbuild-ST-fd81cbb45820/bin/external/+uv+sbuild__pypi__default__bravado_core/.build_venv/bin/python3 uv/private/sdist_build/build_helper.py ... (remaining 2 arguments skipped)
 
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
 
Traceback (most recent call last):
  File "/mnt/ephemeral/output/rules_py/__main__/sandbox/linux-sandbox/2029/execroot/_main/uv/private/sdist_build/build_helper.py", line 7, in <module>
    from build.__main__ import main as build
ModuleNotFoundError: No module named 'build'

💡 To reproduce the build failures, run

bazel build @@+uv+sbuild__pypi__default__bravado_core//:whl

test-os:linux-bzl:latest (Test)

⚠️ Buildkite build #999 is currently failing.

@@+uv+sbuild__pypi__default__bravado_core//:whl failed to build

python3 failed: error executing Action command (from target @@+uv+sbuild__pypi__default__bravado_core//:whl) bazel-out/k8-fastbuild-ST-fd81cbb45820/bin/external/+uv+sbuild__pypi__default__bravado_core/.build_venv/bin/python3 uv/private/sdist_build/build_helper.py ... (remaining 2 arguments skipped)
 
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
 
Traceback (most recent call last):
  File "/mnt/ephemeral/output/rules_py/__main__/sandbox/linux-sandbox/2923/execroot/_main/uv/private/sdist_build/build_helper.py", line 7, in <module>
    from build.__main__ import main as build
ModuleNotFoundError: No module named 'build'

💡 To reproduce the build failures, run

bazel build @@+uv+sbuild__pypi__default__bravado_core//:whl

test-os:linux-bzl:8 (Test)

e2e

⚠️ Buildkite build #999 failed.

Failed tests (2)
//cases/uv-deps-650/crossbuild:app_amd64_layers_test [k8-fastbuild]🔗
//cases/uv-deps-650/crossbuild:app_arm64_layers_test [k8-fastbuild]🔗

💡 To reproduce the test failures, run

bazel test //cases/uv-deps-650/crossbuild:app_amd64_layers_test //cases/uv-deps-650/crossbuild:app_arm64_layers_test

test-os:linux-bzl:latest (Test)

e2e

⚠️ Buildkite build #999 failed.

Failed tests (2)
//cases/uv-deps-650/crossbuild:app_amd64_layers_test [k8-fastbuild]🔗
//cases/uv-deps-650/crossbuild:app_arm64_layers_test [k8-fastbuild]🔗

💡 To reproduce the test failures, run

bazel test //cases/uv-deps-650/crossbuild:app_arm64_layers_test //cases/uv-deps-650/crossbuild:app_amd64_layers_test

test-os:linux-bzl:8 (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 335ms.


test-os:linux-bzl:latest (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 335ms.

@arrdem arrdem force-pushed the arrdem/fix-703 branch 3 times, most recently from 493b2d3 to 7f72e6f Compare November 8, 2025 23:08
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.

[Bug]: ModuleNotFoundError: No module named 'encodings'

3 participants