Skip to content

Commit 97754ca

Browse files
committed
Merge branch 'main' into feat/starlark-env-marker-and-metadata-parsing
2 parents 81512d2 + 965dd51 commit 97754ca

File tree

73 files changed

+2617
-953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2617
-953
lines changed

.bazelci/presubmit.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@ buildifier:
7878
coverage_targets:
7979
- //tests:my_lib_3_10_test
8080
- //tests:my_lib_3_11_test
81-
- //tests:my_lib_3_8_test
8281
- //tests:my_lib_3_9_test
8382
- //tests:my_lib_default_test
8483
- //tests:version_3_10_test
8584
- //tests:version_3_11_test
86-
- //tests:version_3_8_test
8785
- //tests:version_3_9_test
8886
- //tests:version_default_test
8987
tasks:

CHANGELOG.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,52 @@ Unreleased changes template.
5353

5454
{#v0-0-0-changed}
5555
### Changed
56-
* Nothing changed.
56+
* (toolchain) The `exec` configuration toolchain now has the forwarded
57+
`exec_interpreter` now also forwards the `ToolchainInfo` provider. This is
58+
for increased compatibility with the `RBE` setups where access to the `exec`
59+
configuration interpreter is needed.
60+
* (toolchains) Use the latest astral-sh toolchain release [20250317] for Python versions:
61+
* 3.9.21
62+
* 3.10.16
63+
* 3.11.11
64+
* 3.12.9
65+
* 3.13.2
66+
* (pypi) Use `xcrun xcodebuild --showsdks` to find XCode root.
67+
* (pypi) The `bzlmod` extension will now generate smaller lock files for when
68+
using `experimental_index_url`.
69+
* (toolchains) Remove all but `3.8.20` versions of the Python `3.8` interpreter who has
70+
reached EOL. If users still need other versions of the `3.8` interpreter, please supply
71+
the URLs manually {bzl:ob}`python.toolchain` or {bzl:obj}`python_register_toolchains` calls.
72+
73+
[20250317]: https://github.com/astral-sh/python-build-standalone/releases/tag/20250317
5774

5875
{#v0-0-0-fixed}
5976
### Fixed
60-
* Nothing fixed.
77+
* (runfiles) ({obj}`--bootstrap_impl=script`) Follow symlinks when searching for runfiles.
78+
* (toolchains) Do not try to run `chmod` when downloading non-windows hermetic toolchain
79+
repositories on Windows. Fixes
80+
[#2660](https://github.com/bazel-contrib/rules_python/issues/2660).
6181

6282
{#v0-0-0-added}
6383
### Added
64-
* Nothing added.
84+
* (pypi) From now on `sha256` values in the `requirements.txt` is no longer
85+
mandatory when enabling {attr}`pip.parse.experimental_index_url` feature.
86+
This means that `rules_python` will attempt to fetch metadata for all
87+
packages through SimpleAPI unless they are pulled through direct URL
88+
references. Fixes [#2023](https://github.com/bazel-contrib/rules_python/issues/2023).
89+
In case you see issues with `rules_python` being too eager to fetch the SimpleAPI
90+
metadata, you can use the newly added {attr}`pip.parse.experimental_skip_sources`
91+
to skip metadata fetching for those packages.
92+
* (uv) A {obj}`lock` rule that is the replacement for the
93+
{obj}`compile_pip_requirements`. This may still have rough corners
94+
so please report issues with it in the
95+
[#1975](https://github.com/bazel-contrib/rules_python/issues/1975).
96+
Main highlights - the locking can be done within a build action or outside
97+
it, there is no more automatic `test` target (but it can be added on the user
98+
side by using `native_test`). For customizing the `uv` version that is used,
99+
please check the {obj}`uv.configure` tag class.
100+
* Add support for riscv64 linux platform.
101+
* (toolchains) Add python 3.13.2 and 3.12.9 toolchains
65102

66103
{#v0-0-0-removed}
67104
### Removed
@@ -101,6 +138,9 @@ Unreleased changes template.
101138

102139
{#v1-3-0-added}
103140
### Added
141+
* (python) {attr}`python.defaults` has been added to allow users to
142+
set the default python version in the root module by reading the
143+
default version number from a file or an environment variable.
104144
* {obj}`//python/bin:python`: convenience target for directly running an
105145
interpreter. {obj}`--//python/bin:python_src` can be used to specify a
106146
binary whose interpreter to use.

MODULE.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ dev_pip.parse(
131131
download_only = True,
132132
experimental_index_url = "https://pypi.org/simple",
133133
hub_name = "dev_pip",
134-
python_version = "3.13.0",
134+
python_version = "3.13",
135135
requirements_lock = "//docs:requirements.txt",
136136
)
137137
dev_pip.parse(
@@ -221,6 +221,13 @@ uv.default(
221221
],
222222
platform = "s390x-unknown-linux-gnu",
223223
)
224+
uv.default(
225+
compatible_with = [
226+
"@platforms//os:linux",
227+
"@platforms//cpu:riscv64",
228+
],
229+
platform = "riscv64-unknown-linux-gnu",
230+
)
224231
uv.default(
225232
compatible_with = [
226233
"@platforms//os:macos",

docs/BUILD.bazel

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,12 @@ lock(
176176
name = "requirements",
177177
srcs = ["pyproject.toml"],
178178
out = "requirements.txt",
179-
upgrade = True,
180-
visibility = ["//private:__pkg__"],
179+
args = [
180+
"--emit-index-url",
181+
"--universal",
182+
"--upgrade",
183+
],
184+
visibility = ["//:__subpackages__"],
181185
)
182186

183187
# Temporary compatibility aliases for some other projects depending on the old

docs/pypi-dependencies.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,13 @@ This does not mean that `rules_python` is fetching the wheels eagerly, but it
386386
rather means that it is calling the PyPI server to get the Simple API response
387387
to get the list of all available source and wheel distributions. Once it has
388388
got all of the available distributions, it will select the right ones depending
389-
on the `sha256` values in your `requirements_lock.txt` file. The compatible
390-
distribution URLs will be then written to the `MODULE.bazel.lock` file. Currently
391-
users wishing to use the lock file with `rules_python` with this feature have
392-
to set an environment variable `RULES_PYTHON_OS_ARCH_LOCK_FILE=0` which will
393-
become default in the next release.
389+
on the `sha256` values in your `requirements_lock.txt` file. If `sha256` hashes
390+
are not present in the requirements file, we will fallback to matching by version
391+
specified in the lock file. The compatible distribution URLs will be then
392+
written to the `MODULE.bazel.lock` file. Currently users wishing to use the
393+
lock file with `rules_python` with this feature have to set an environment
394+
variable `RULES_PYTHON_OS_ARCH_LOCK_FILE=0` which will become default in the
395+
next release.
394396

395397
Fetching the distribution information from the PyPI allows `rules_python` to
396398
know which `whl` should be used on which target platform and it will determine

docs/requirements.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ astroid==3.3.6 \
1414
--hash=sha256:6aaea045f938c735ead292204afdb977a36e989522b7833ef6fea94de743f442 \
1515
--hash=sha256:db676dc4f3ae6bfe31cda227dc60e03438378d7a896aec57422c95634e8d722f
1616
# via sphinx-autodoc2
17-
babel==2.16.0 \
18-
--hash=sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b \
19-
--hash=sha256:d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316
17+
babel==2.17.0 \
18+
--hash=sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d \
19+
--hash=sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2
2020
# via sphinx
21-
certifi==2024.8.30 \
22-
--hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \
23-
--hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9
21+
certifi==2025.1.31 \
22+
--hash=sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651 \
23+
--hash=sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe
2424
# via requests
2525
charset-normalizer==3.4.0 \
2626
--hash=sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621 \
@@ -236,15 +236,15 @@ myst-parser==4.0.0 \
236236
--hash=sha256:851c9dfb44e36e56d15d05e72f02b80da21a9e0d07cba96baf5e2d476bb91531 \
237237
--hash=sha256:b9317997552424448c6096c2558872fdb6f81d3ecb3a40ce84a7518798f3f28d
238238
# via rules-python-docs (docs/pyproject.toml)
239-
packaging==24.1 \
240-
--hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \
241-
--hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124
239+
packaging==24.2 \
240+
--hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \
241+
--hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f
242242
# via
243243
# readthedocs-sphinx-ext
244244
# sphinx
245-
pygments==2.18.0 \
246-
--hash=sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199 \
247-
--hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a
245+
pygments==2.19.1 \
246+
--hash=sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f \
247+
--hash=sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c
248248
# via sphinx
249249
pyyaml==6.0.2 \
250250
--hash=sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff \
@@ -328,9 +328,9 @@ sphinx-autodoc2==0.5.0 \
328328
--hash=sha256:7d76044aa81d6af74447080182b6868c7eb066874edc835e8ddf810735b6565a \
329329
--hash=sha256:e867013b1512f9d6d7e6f6799f8b537d6884462acd118ef361f3f619a60b5c9e
330330
# via rules-python-docs (docs/pyproject.toml)
331-
sphinx-reredirects==0.1.5 \
332-
--hash=sha256:444ae1438fba4418242ca76d6a6de3eaee82aaf0d8f2b0cac71a15d32ce6eba2 \
333-
--hash=sha256:cfa753b441020a22708ce8eb17d4fd553a28fc87a609330092917ada2a6da0d8
331+
sphinx-reredirects==0.1.6 \
332+
--hash=sha256:c491cba545f67be9697508727818d8626626366245ae64456fe29f37e9bbea64 \
333+
--hash=sha256:efd50c766fbc5bf40cd5148e10c00f2c00d143027de5c5e48beece93cc40eeea
334334
# via rules-python-docs (docs/pyproject.toml)
335335
sphinx-rtd-theme==3.0.1 \
336336
--hash=sha256:921c0ece75e90633ee876bd7b148cfaad136b481907ad154ac3669b6fc957916 \
@@ -370,7 +370,7 @@ typing-extensions==4.12.2 \
370370
# via
371371
# rules-python-docs (docs/pyproject.toml)
372372
# sphinx-autodoc2
373-
urllib3==2.2.3 \
374-
--hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \
375-
--hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9
373+
urllib3==2.3.0 \
374+
--hash=sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df \
375+
--hash=sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d
376376
# via requests

examples/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ lock(
2121
name = "bzlmod_requirements_3_9",
2222
srcs = ["bzlmod/requirements.in"],
2323
out = "bzlmod/requirements_lock_3_9.txt",
24+
args = [
25+
"--emit-index-url",
26+
"--universal",
27+
"--python-version=3.9",
28+
],
2429
python_version = "3.9.19",
2530
)

examples/bzlmod/requirements_lock_3_9.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ imagesize==1.4.1 \
4646
--hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \
4747
--hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a
4848
# via sphinx
49-
importlib-metadata==8.4.0 ; python_version < '3.10' \
49+
importlib-metadata==8.4.0 ; python_full_version < '3.10' \
5050
--hash=sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1 \
5151
--hash=sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5
5252
# via sphinx
@@ -316,15 +316,15 @@ tabulate==0.9.0 \
316316
--hash=sha256:0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c \
317317
--hash=sha256:024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f
318318
# via -r examples/bzlmod/requirements.in
319-
tomli==2.0.1 ; python_version < '3.11' \
319+
tomli==2.0.1 ; python_full_version < '3.11' \
320320
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
321321
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
322322
# via pylint
323323
tomlkit==0.11.6 \
324324
--hash=sha256:07de26b0d8cfc18f871aec595fda24d95b08fef89d147caa861939f37230bf4b \
325325
--hash=sha256:71b952e5721688937fb02cf9d354dbcf0785066149d2855e44531ebdd2b65d73
326326
# via pylint
327-
typing-extensions==4.12.2 ; python_version < '3.10' \
327+
typing-extensions==4.12.2 ; python_full_version < '3.10' \
328328
--hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \
329329
--hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8
330330
# via
@@ -480,7 +480,7 @@ yamllint==1.28.0 \
480480
--hash=sha256:89bb5b5ac33b1ade059743cf227de73daa34d5e5a474b06a5e17fc16583b0cf2 \
481481
--hash=sha256:9e3d8ddd16d0583214c5fdffe806c9344086721f107435f68bad990e5a88826b
482482
# via -r examples/bzlmod/requirements.in
483-
zipp==3.20.0 ; python_version < '3.10' \
483+
zipp==3.20.0 ; python_full_version < '3.10' \
484484
--hash=sha256:0145e43d89664cfe1a2e533adc75adafed82fe2da404b4bbb6b026c0157bdb31 \
485485
--hash=sha256:58da6168be89f0be59beb194da1250516fdaa062ccebd30127ac65d30045e10d
486486
# via importlib-metadata

examples/bzlmod_build_file_generation/requirements_lock.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ dill==0.3.6 \
2626
--hash=sha256:a07ffd2351b8c678dfc4a856a3005f8067aea51d6ba6c700796a4d9e280f39f0 \
2727
--hash=sha256:e5db55f3687856d8fbdab002ed78544e1c4559a130302693d839dfe8f93f2373
2828
# via pylint
29-
django==4.2.17 \
30-
--hash=sha256:3a93350214ba25f178d4045c0786c61573e7dbfa3c509b3551374f1e11ba8de0 \
31-
--hash=sha256:6b56d834cc94c8b21a8f4e775064896be3b4a4ca387f2612d4406a5927cd2fdc
29+
django==4.2.20 \
30+
--hash=sha256:213381b6e4405f5c8703fffc29cd719efdf189dec60c67c04f76272b3dc845b9 \
31+
--hash=sha256:92bac5b4432a64532abb73b2ac27203f485e40225d2640a7fbef2b62b876e789
3232
# via
3333
# -r requirements.in
3434
# django-stubs

examples/bzlmod_build_file_generation/requirements_windows.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ dill==0.3.6 \
3030
--hash=sha256:a07ffd2351b8c678dfc4a856a3005f8067aea51d6ba6c700796a4d9e280f39f0 \
3131
--hash=sha256:e5db55f3687856d8fbdab002ed78544e1c4559a130302693d839dfe8f93f2373
3232
# via pylint
33-
django==4.2.17 \
34-
--hash=sha256:3a93350214ba25f178d4045c0786c61573e7dbfa3c509b3551374f1e11ba8de0 \
35-
--hash=sha256:6b56d834cc94c8b21a8f4e775064896be3b4a4ca387f2612d4406a5927cd2fdc
33+
django==4.2.20 \
34+
--hash=sha256:213381b6e4405f5c8703fffc29cd719efdf189dec60c67c04f76272b3dc845b9 \
35+
--hash=sha256:92bac5b4432a64532abb73b2ac27203f485e40225d2640a7fbef2b62b876e789
3636
# via
3737
# -r requirements.in
3838
# django-stubs

0 commit comments

Comments
 (0)