Skip to content

Commit 80e78f4

Browse files
authored
Merge branch 'release/1.5' into release/1.5
2 parents 16279fd + 34051e0 commit 80e78f4

File tree

9 files changed

+71
-12
lines changed

9 files changed

+71
-12
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,35 @@ END_UNRELEASED_TEMPLATE
5656
### Fixed
5757

5858
* fix(local_runtime): Search for libs in sys._base_executable when available. #3178
59+
gg=======
60+
{#1-5-3}
61+
## [1.5.3] - 2025-08-11
62+
63+
[1.5.3]: https://github.com/bazel-contrib/rules_python/releases/tag/1.5.3
64+
65+
{#v1-5-3-fixed}
66+
### Fixed
67+
* (toolchains) `local_runtime_repo` now checks if the include directory exists
68+
before attempting to watch it, fixing issues on macOS with system Python
69+
({gh-issue}`3043`).
70+
71+
{#1-5-2}
72+
## [1.5.2] - 2025-08-11
73+
74+
[1.5.2]: https://github.com/bazel-contrib/rules_python/releases/tag/1.5.2
75+
76+
{#v1-5-2-changed}
77+
### Changed
78+
* (deps) (bzlmod) Upgraded to `bazel-skylib` version
79+
[1.8.1](https://github.com/bazelbuild/bazel-skylib/releases/tag/1.8.1)
80+
to remove deprecation warnings.
81+
82+
{#v1-5-2-fixed}
83+
### Fixed
84+
* (pypi) Correctly pull `sdist` distributions using `pip`
85+
([#3131](https://github.com/bazel-contrib/rules_python/pull/3131)).
86+
* (core) builds work again on `7.x` `WORKSPACE` configurations
87+
([#3119](https://github.com/bazel-contrib/rules_python/issues/3119)).
5988

6089
{#1-5-1}
6190
## [1.5.1] - 2025-07-06

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module(
55
)
66

77
bazel_dep(name = "bazel_features", version = "1.21.0")
8-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
8+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
99
bazel_dep(name = "rules_cc", version = "0.0.16")
1010
bazel_dep(name = "platforms", version = "0.0.11")
1111

python/private/local_runtime_repo.bzl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@ def _local_runtime_repo_impl(rctx):
9999
interpreter_path = info["base_executable"]
100100

101101
# NOTE: Keep in sync with recursive glob in define_local_runtime_toolchain_impl
102-
repo_utils.watch_tree(rctx, rctx.path(info["include"]))
102+
include_path = rctx.path(info["include"])
103+
104+
# The reported include path may not exist, and watching a non-existant
105+
# path is an error. Silently skip, since includes are only necessary
106+
# if C extensions are built.
107+
if include_path.exists and include_path.is_dir:
108+
repo_utils.watch_tree(rctx, include_path)
109+
else:
110+
pass
103111

104112
# The cc_library.includes values have to be non-absolute paths, otherwise
105113
# the toolchain will give an error. Work around this error by making them

python/private/py_executable.bzl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ def _create_stage1_bootstrap(
796796
is_for_zip,
797797
runtime_details,
798798
venv = None):
799+
"""Create a legacy bootstrap script that is written in Python."""
799800
runtime = runtime_details.effective_runtime
800801

801802
if venv:
@@ -805,8 +806,11 @@ def _create_stage1_bootstrap(
805806

806807
python_binary_actual = venv.interpreter_actual_path if venv else ""
807808

808-
# Runtime may be None on Windows due to the --python_path flag.
809-
if runtime and runtime.supports_build_time_venv:
809+
# Guard against the following:
810+
# * Runtime may be None on Windows due to the --python_path flag.
811+
# * Runtime may not have 'supports_build_time_venv' if a really old version is autoloaded
812+
# on bazel 7.6.x.
813+
if runtime and getattr(runtime, "supports_build_time_venv", False):
810814
resolve_python_binary_at_runtime = "0"
811815
else:
812816
resolve_python_binary_at_runtime = "1"

python/private/pypi/index_sources.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ def index_sources(line):
9393
is_known_ext = True
9494
break
9595

96-
if is_known_ext:
96+
requirement = requirement_line
97+
if filename.endswith(".whl"):
9798
requirement = maybe_requirement.strip()
98-
else:
99+
elif not is_known_ext:
99100
# could not detect filename from the URL
100101
filename = ""
101-
requirement = requirement_line
102102

103103
return struct(
104104
requirement = requirement,

python/private/pypi/pip_compile.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,5 @@ def pip_compile(
196196
name = "{}_test".format(name),
197197
actual = ":{}.test".format(name),
198198
deprecation = "Use '{}.test' instead. The '*_test' target will be removed in the next major release.".format(name),
199+
tags = ["manual"],
199200
)

tests/pypi/extension/extension_tests.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ git_dep @ git+https://git.server/repo/project@deadbeefdeadbeef
811811
"extra_pip_args": ["--extra-args-for-sdist-building"],
812812
"filename": "any-name.tar.gz",
813813
"python_interpreter_target": "unit_test_interpreter_target",
814-
"requirement": "direct_sdist_without_sha",
814+
"requirement": "direct_sdist_without_sha @ some-archive/any-name.tar.gz",
815815
"sha256": "",
816816
"urls": ["some-archive/any-name.tar.gz"],
817817
},

tests/pypi/index_sources/index_sources_tests.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def _test_no_simple_api_sources(env):
7373
filename = "package.whl",
7474
),
7575
"foo[extra] @ https://example.org/foo-1.0.tar.gz --hash=sha256:deadbe0f": struct(
76-
requirement = "foo[extra]",
76+
# NOTE @aignas 2025-08-03: we need to ensure that sdists continue working
77+
# when we are using pip to install them even if the experimental_index_url
78+
# code path is used.
79+
requirement = "foo[extra] @ https://example.org/foo-1.0.tar.gz --hash=sha256:deadbe0f",
7780
requirement_line = "foo[extra] @ https://example.org/foo-1.0.tar.gz --hash=sha256:deadbe0f",
7881
marker = "",
7982
url = "https://example.org/foo-1.0.tar.gz",

tests/pypi/parse_requirements/parse_requirements_tests.bzl

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ foo==0.0.1 \
2727
""",
2828
"requirements_direct": """\
2929
foo[extra] @ https://some-url/package.whl
30+
""",
31+
"requirements_direct_sdist": """
32+
foo @ https://github.com/org/foo/downloads/foo-1.1.tar.gz
3033
""",
3134
"requirements_extra_args": """\
3235
--index-url=example.org
@@ -131,22 +134,33 @@ def _test_direct_urls_integration(env):
131134
ctx = _mock_ctx(),
132135
requirements_by_platform = {
133136
"requirements_direct": ["linux_x86_64"],
137+
"requirements_direct_sdist": ["osx_x86_64"],
134138
},
135139
)
136140
env.expect.that_collection(got).contains_exactly([
137141
struct(
138142
name = "foo",
139143
is_exposed = True,
140-
is_multiple_versions = False,
144+
is_multiple_versions = True,
141145
srcs = [
142146
struct(
143147
distribution = "foo",
144148
extra_pip_args = [],
149+
filename = "foo-1.1.tar.gz",
150+
requirement_line = "foo @ https://github.com/org/foo/downloads/foo-1.1.tar.gz",
151+
sha256 = "",
152+
target_platforms = ["osx_x86_64"],
153+
url = "https://github.com/org/foo/downloads/foo-1.1.tar.gz",
154+
yanked = False,
155+
),
156+
struct(
157+
distribution = "foo",
158+
extra_pip_args = [],
159+
filename = "package.whl",
145160
requirement_line = "foo[extra]",
161+
sha256 = "",
146162
target_platforms = ["linux_x86_64"],
147163
url = "https://some-url/package.whl",
148-
filename = "package.whl",
149-
sha256 = "",
150164
yanked = False,
151165
),
152166
],

0 commit comments

Comments
 (0)