Skip to content

Commit 3c83b87

Browse files
committed
Merge branch 'main' of https://github.com/bazel-contrib/rules_python into feat.local.runtimes
2 parents 6e6fcd6 + 6821709 commit 3c83b87

File tree

11 files changed

+547
-604
lines changed

11 files changed

+547
-604
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Unreleased changes template.
9090
transitions transitioning on the `python_version` flag.
9191
Fixes [#2685](https://github.com/bazel-contrib/rules_python/issues/2685).
9292
* (toolchains) Run the check on the Python interpreter in isolated mode, to ensure it's not affected by userland environment variables, such as `PYTHONPATH`.
93+
* (toolchains) Ensure temporary `.pyc` and `.pyo` files are also excluded from the interpreters repository files.
9394

9495
{#v0-0-0-added}
9596
### Added

docs/requirements.txt

Lines changed: 99 additions & 112 deletions
Large diffs are not rendered by default.

examples/pip_parse/requirements_lock.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ importlib-metadata==6.8.0 \
3636
--hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \
3737
--hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743
3838
# via sphinx
39-
jinja2==3.1.4 \
40-
--hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \
41-
--hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d
39+
jinja2==3.1.6 \
40+
--hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \
41+
--hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67
4242
# via sphinx
4343
markupsafe==2.1.3 \
4444
--hash=sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e \

examples/pip_parse/requirements_windows.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ importlib-metadata==6.8.0 \
4040
--hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \
4141
--hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743
4242
# via sphinx
43-
jinja2==3.1.4 \
44-
--hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \
45-
--hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d
43+
jinja2==3.1.6 \
44+
--hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \
45+
--hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67
4646
# via sphinx
4747
markupsafe==2.1.3 \
4848
--hash=sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e \

python/private/py_runtime_info.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ load(":util.bzl", "define_bazel_6_provider")
1717

1818
DEFAULT_STUB_SHEBANG = "#!/usr/bin/env python3"
1919

20-
DEFAULT_BOOTSTRAP_TEMPLATE = Label("//python/private:bootstrap_template")
21-
2220
_PYTHON_VERSION_VALUES = ["PY2", "PY3"]
2321

2422
def _optional_int(value):

python/private/py_runtime_rule.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
1919
load(":attributes.bzl", "NATIVE_RULES_ALLOWLIST_ATTRS")
2020
load(":flags.bzl", "FreeThreadedFlag")
2121
load(":py_internal.bzl", "py_internal")
22-
load(":py_runtime_info.bzl", "DEFAULT_BOOTSTRAP_TEMPLATE", "DEFAULT_STUB_SHEBANG", "PyRuntimeInfo")
22+
load(":py_runtime_info.bzl", "DEFAULT_STUB_SHEBANG", "PyRuntimeInfo")
2323
load(":reexports.bzl", "BuiltinPyRuntimeInfo")
2424
load(":util.bzl", "IS_BAZEL_7_OR_HIGHER")
2525

@@ -201,7 +201,7 @@ If not set, then it will be set based on flags.
201201
),
202202
"bootstrap_template": attr.label(
203203
allow_single_file = True,
204-
default = DEFAULT_BOOTSTRAP_TEMPLATE,
204+
default = Label("//python/private:bootstrap_template"),
205205
doc = """
206206
The bootstrap script template file to use. Should have %python_binary%,
207207
%workspace_name%, %main%, and %imports%.

python/private/python_repository.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ def _python_repository_impl(rctx):
193193
# Exclude them from the glob because otherwise between the first time and second time a python toolchain is used,"
194194
# the definition of this filegroup will change, and depending rules will get invalidated."
195195
# See https://github.com/bazel-contrib/rules_python/issues/1008 for unconditionally adding these to toolchains so we can stop ignoring them."
196-
"**/__pycache__/*.pyc",
197-
"**/__pycache__/*.pyo",
196+
# pyc* is ignored because pyc creation creates temporary .pyc.NNNN files
197+
"**/__pycache__/*.pyc*",
198+
"**/__pycache__/*.pyo*",
198199
]
199200

200201
if "windows" in platform:

tools/publish/requirements_darwin.txt

Lines changed: 93 additions & 106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/publish/requirements_linux.txt

Lines changed: 125 additions & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/publish/requirements_universal.txt

Lines changed: 125 additions & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)