Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ interpreters.configure(
"20251031",
],
)
interpreters.toolchain(
python_version = "3.11",
)
interpreters.toolchain(
python_version = "3.13",
)
Expand All @@ -65,6 +68,14 @@ use_repo(
"python_interpreters",
# Individual platform repos — must be visible so the uv extension can
# reference the host interpreter for sdist configure tooling.
"python_3_11_aarch64_apple_darwin",
"python_3_11_aarch64_unknown_linux_gnu",
"python_3_11_aarch64_unknown_linux_musl",
"python_3_11_i686_pc_windows_msvc",
"python_3_11_x86_64_apple_darwin",
"python_3_11_x86_64_pc_windows_msvc",
"python_3_11_x86_64_unknown_linux_gnu",
"python_3_11_x86_64_unknown_linux_musl",
"python_3_13_aarch64_apple_darwin",
"python_3_13_aarch64_unknown_linux_gnu",
"python_3_13_aarch64_unknown_linux_musl",
Expand Down
8 changes: 8 additions & 0 deletions py/private/py_pex_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ exclude_paths = [
# these will match in bzlmod setup with --incompatible_use_plus_in_repo_names flag flipped.
"rules_python++python+",
"aspect_rules_py+/py/tools/",
# these will match the hermetic python interpreter from rules_py extension
"python_interpreters~",
"python_interpreters+",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need the ~ version as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think if CI passed then either this line is not needed or it is not being tested...

]

# determines if the given file is a `distinfo`, `dep` or a `source`
Expand All @@ -54,6 +57,11 @@ def _map_srcs(f, workspace):
if dest_path.find(exclude) != -1:
return []

if "_distutils_hack" in f.path:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

return []
if "distutils-precedence.pth" in f.path:
return []

site_packages_i = f.path.find("site-packages")

# If the path contains 'site-packages', treat it as a third party dep
Expand Down
2 changes: 2 additions & 0 deletions py/tests/py-pex-binary/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("//py:defs.bzl", "py_binary", "py_pex_binary")

# Test that both single-file modules (six) and multi-file modules (cowsay) work with py_pex_binary.
# Also tests that py_pex_binary works with hermetic Python toolchains (python_version = 3.11).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can that be a separate test? This is replacing an old test, not "also" testing something...

py_binary(
name = "print_modules_bin",
srcs = ["print_modules.py"],
data = ["data.txt"],
python_version = "3.11",
deps = [
"@pypi//cowsay",
"@pypi//six",
Expand Down