Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/test_upb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: "upb-bazel-windows"
bazel: test //upb/... //upb_generator/... //python/... --noenable_bzlmod
bazel: test //upb/... //upb_generator/... //python/...
version: 7.6.1
exclude-targets: -//python:conformance_test -//upb/reflection:def_builder_test

Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_depen
hub_name = "protobuf_pip_deps",
python_interpreter_target = "@system_python//:interpreter",
python_version = python_version,
requirements_lock = "//python:requirements.txt",
requirements_lock = "//python:requirements_lock.txt",
)
for python_version in SUPPORTED_PYTHON_VERSIONS
]
Expand Down
16 changes: 11 additions & 5 deletions python/dist/system_python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ selects.config_setting_group(

sh_binary(
name = "interpreter",
srcs = ["interpreter"],
srcs = ["{wrapper}"],
visibility = ["//visibility:public"],
)

Expand Down Expand Up @@ -175,17 +175,21 @@ def _populate_package(ctx, path, python3, python_version):
if int(python_version[idx]) < int(v):
supported = False
break

if "win" in ctx.os.name:
# buildifier: disable=print
print("WARNING: python is not supported on Windows")
supported = False
wrapper = "interpreter.bat"
ctx.file("interpreter.bat", "{} %*".format(python3))
ctx.symlink("interpreter.bat", "interpreter")
else:
wrapper = "interpreter"
ctx.file("interpreter", "#!/bin/sh\nexec {} \"$@\"".format(python3))

build_file = _build_file.format(
interpreter = python3,
wrapper = wrapper,
support = "Supported" if supported else "Unsupported",
)

ctx.file("interpreter", "#!/bin/sh\nexec {} \"$@\"".format(python3))
ctx.file("BUILD.bazel", build_file)
ctx.file("version.bzl", "SYSTEM_PYTHON_VERSION = '{}{}'".format(python_version[0], python_version[1]))
ctx.file("register.bzl", _register.format(ctx.attr.name))
Expand All @@ -208,9 +212,11 @@ def _populate_empty_package(ctx):
"BUILD.bazel",
_build_file.format(
interpreter = "",
wrapper = "interpreter",
support = "None",
),
)
ctx.file("interpreter", "#!/bin/sh")
ctx.file("version.bzl", "SYSTEM_PYTHON_VERSION = 'None'")
ctx.file("register.bzl", _mock_register)
ctx.file("pip.bzl", _mock_pip)
Expand Down
3 changes: 3 additions & 0 deletions python/requirements_lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy==2.1.0
setuptools==65.5.0
absl-py==2.3.1
Loading