Skip to content

Commit 086c6aa

Browse files
authored
Merge branch 'main' into gazelle-plugin-generates-py-proto-library
2 parents 3d3c302 + 2690e3f commit 086c6aa

File tree

7 files changed

+223
-135
lines changed

7 files changed

+223
-135
lines changed

CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ END_UNRELEASED_TEMPLATE
6060
* (gazelle) Types for exposed members of `python.ParserOutput` are now all public.
6161
* (gazelle) Removed the requirement for `__init__.py`, `__main__.py`, or `__test__.py` files to be
6262
present in a directory to generate a `BUILD.bazel` file.
63-
* (toolchain) Updated the following toolchains to build 20250612 to patch CVE-2025-47273:
63+
* (toolchain) Updated the following toolchains to build 20250702 to patch CVE-2025-47273:
6464
* 3.9.23
6565
* 3.10.18
6666
* 3.11.13
6767
* 3.12.11
68-
* 3.14.0b2
68+
* 3.14.0b3
6969
* (toolchain) Python 3.13 now references 3.13.5
7070

7171
{#v0-0-0-fixed}
@@ -91,13 +91,30 @@ END_UNRELEASED_TEMPLATE
9191
* (gazelle) New directive `gazelle:python_generate_pyi_deps`; when `true`,
9292
dependencies added to satisfy type-only imports (`if TYPE_CHECKING`) and type
9393
stub packages are added to `pyi_deps` instead of `deps`.
94+
* (toolchain) Add toolchains for aarch64 windows for
95+
* 3.11.13
96+
* 3.12.11
97+
* 3.13.5
98+
* 3.14.0b3
9499
* (gazelle) New directive `gazelle:python_generate_proto`; when `true`,
95100
Gazelle generates `py_proto_library` rules for `proto_library`. `false` by default.
96101

97102
{#v0-0-0-removed}
98103
### Removed
99104
* Nothing removed.
100105

106+
{#1-5-1}
107+
## [1.5.1] - 2025-07-06
108+
109+
[1.5.1]: https://github.com/bazel-contrib/rules_python/releases/tag/1.5.1
110+
111+
{#v1-5-1-fixed}
112+
### Fixed
113+
114+
* (pypi) Namespace packages work by default (pkgutil shims are generated
115+
by default again)
116+
([#3038](https://github.com/bazel-contrib/rules_python/issues/3038)).
117+
101118
{#1-5-0}
102119
## [1.5.0] - 2025-06-11
103120

python/private/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
1616
load("@bazel_skylib//rules:common_settings.bzl", "bool_setting")
1717
load("//python:py_binary.bzl", "py_binary")
1818
load("//python:py_library.bzl", "py_library")
19-
load("//python:versions.bzl", "print_toolchains_checksums")
19+
load(":print_toolchain_checksums.bzl", "print_toolchains_checksums")
2020
load(":py_exec_tools_toolchain.bzl", "current_interpreter_executable")
2121
load(":sentinel.bzl", "sentinel")
2222
load(":stamp.bzl", "stamp_build_setting")
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
"""Print the toolchain versions.
2+
"""
3+
4+
load("//python:versions.bzl", "TOOL_VERSIONS", "get_release_info")
5+
load("//python/private:text_util.bzl", "render")
6+
load("//python/private:version.bzl", "version")
7+
8+
def print_toolchains_checksums(name):
9+
"""A macro to print checksums for a particular Python interpreter version.
10+
11+
Args:
12+
name: {type}`str`: the name of the runnable target.
13+
"""
14+
by_version = {}
15+
16+
for python_version, metadata in TOOL_VERSIONS.items():
17+
by_version[python_version] = _commands_for_version(
18+
python_version = python_version,
19+
metadata = metadata,
20+
)
21+
22+
all_commands = sorted(
23+
by_version.items(),
24+
key = lambda x: version.key(version.parse(x[0], strict = True)),
25+
)
26+
all_commands = [x[1] for x in all_commands]
27+
28+
template = """\
29+
cat > "$@" <<'EOF'
30+
#!/bin/bash
31+
32+
set -o errexit -o nounset -o pipefail
33+
34+
echo "Fetching hashes..."
35+
36+
{commands}
37+
EOF
38+
"""
39+
40+
native.genrule(
41+
name = name,
42+
srcs = [],
43+
outs = ["print_toolchains_checksums.sh"],
44+
cmd = select({
45+
"//python/config_settings:is_python_{}".format(version_str): template.format(
46+
commands = commands,
47+
)
48+
for version_str, commands in by_version.items()
49+
} | {
50+
"//conditions:default": template.format(commands = "\n".join(all_commands)),
51+
}),
52+
executable = True,
53+
)
54+
55+
def _commands_for_version(*, python_version, metadata):
56+
lines = []
57+
lines += [
58+
"cat <<EOB", # end of block
59+
" \"{python_version}\": {{".format(python_version = python_version),
60+
" \"url\": \"{url}\",".format(url = metadata["url"]),
61+
" \"sha256\": {",
62+
]
63+
64+
for platform in metadata["sha256"].keys():
65+
for release_url in get_release_info(platform, python_version)[1]:
66+
# Do lines one by one so that the progress is seen better and use cat for ease of quotation
67+
lines += [
68+
"EOB",
69+
"cat <<EOB",
70+
" \"{platform}\": \"$$({get_sha256})\",".format(
71+
platform = platform,
72+
get_sha256 = "curl --silent --show-error --location --fail {release_url_sha256}".format(
73+
release_url = release_url,
74+
release_url_sha256 = release_url + ".sha256",
75+
),
76+
),
77+
]
78+
79+
prefix = metadata["strip_prefix"]
80+
prefix = render.indent(
81+
render.dict(prefix) if type(prefix) == type({}) else repr(prefix),
82+
indent = " " * 8,
83+
).lstrip()
84+
85+
lines += [
86+
" },",
87+
" \"strip_prefix\": {strip_prefix},".format(strip_prefix = prefix),
88+
" },",
89+
"EOB",
90+
]
91+
92+
return "\n".join(lines)

python/private/pypi/whl_library_targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def whl_library_targets(
331331
allow_empty = True,
332332
)
333333

334-
if enable_implicit_namespace_pkgs:
334+
if not enable_implicit_namespace_pkgs:
335335
srcs = srcs + getattr(native, "select", select)({
336336
Label("//python/config_settings:is_venvs_site_packages"): [],
337337
"//conditions:default": create_inits(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy