Skip to content

Commit 782ae91

Browse files
authored
fix(uv): drop powerpc64 support to fix latest version downloads (#3678)
Before this PR we would index all of the available binaries and it would fail in the case if the `sha256` file is not found. It seems that this is the case for the `powerpc64`. In order to work this around, we just drop support for that particular platform. Whilst at it, bump the uv version. Fixes #3676.
1 parent 900d557 commit 782ae91

File tree

4 files changed

+39
-13
lines changed

4 files changed

+39
-13
lines changed

.github/workflows/mypy.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ jobs:
2121
- uses: actions/checkout@v6
2222
- uses: jpetrucciani/mypy-check@master
2323
with:
24-
requirements: 1.6.0
25-
python_version: 3.9
2624
path: 'python/runfiles'
2725
- uses: jpetrucciani/mypy-check@master
2826
with:
29-
requirements: 1.6.0
30-
python_version: 3.9
3127
path: 'tests/runfiles'

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ Other changes:
8181
Fixes
8282
([#3260](https://github.com/bazel-contrib/rules_python/issues/3260) and
8383
[#2632](https://github.com/bazel-contrib/rules_python/issues/2632)).
84+
* (uv) We will now use the download URL specified in the `uv`'s `dist_manifest.json`
85+
file. If you have redirects or blocking rules as part of your downloader setup,
86+
you may need to adjust them. What is more, the default uv version has been bumped
87+
`0.11.2`.
88+
* (runfiles): We are stopping the type annotation testing with `mypy` for Python 3.9.
8489

8590
{#v0-0-0-fixed}
8691
### Fixed
@@ -97,6 +102,19 @@ Other changes:
97102
* (bootstrap) Fixed incorrect runfiles path construction in bootstrap
98103
scripts when binary is defined in another bazel module
99104
([#3563](https://github.com/bazel-contrib/rules_python/issues/3563)).
105+
* (uv) Downloads for versions `>=0.10` work again. In order to fix this we had
106+
drop support for `powerpc64` platform. People interested in the platform can
107+
bring it back via the `uv.default` API. Like:
108+
```
109+
uv.default(
110+
compatible_with = [
111+
"@platforms//os:linux",
112+
"@platforms//cpu:ppc",
113+
],
114+
platform = "powerpc64-unknown-linux-gnu",
115+
)
116+
```
117+
Fixes [#3676](https://github.com/bazel-contrib/rules_python/issues/3676).
100118

101119
{#v0-0-0-added}
102120
### Added

MODULE.bazel

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ uv = use_extension("//python/uv:uv.bzl", "uv")
385385
uv.default(
386386
base_url = "https://github.com/astral-sh/uv/releases/download",
387387
manifest_filename = "dist-manifest.json",
388-
version = "0.6.3",
388+
version = "0.11.2",
389389
)
390390
uv.default(
391391
compatible_with = [
@@ -401,13 +401,6 @@ uv.default(
401401
],
402402
platform = "aarch64-unknown-linux-gnu",
403403
)
404-
uv.default(
405-
compatible_with = [
406-
"@platforms//os:linux",
407-
"@platforms//cpu:ppc",
408-
],
409-
platform = "powerpc64-unknown-linux-gnu",
410-
)
411404
uv.default(
412405
compatible_with = [
413406
"@platforms//os:linux",
@@ -460,7 +453,7 @@ uv_dev = use_extension(
460453
dev_dependency = True,
461454
)
462455
uv_dev.configure(
463-
version = "0.6.2",
456+
version = "0.11.2",
464457
)
465458

466459
# Temporarily comment out these flag aliases because they break Bazel 9

python/uv/private/uv.bzl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,17 @@ def _get_tool_urls_from_dist_manifest(module_ctx, *, base_url, manifest_filename
420420
"uv-aarch64-apple-darwin.tar.gz.sha256"
421421
"...
422422
]
423+
hosting
424+
order
425+
0 "simple"
426+
1 "github"
427+
github
428+
artifact_base_url "https://github.com"
429+
artifact_download_path "/astral-sh/uv/releases/download/0.11.2"
430+
owner "astral-sh"
431+
repo "uv"
432+
simple
433+
download_url "https://releases.astral.sh/github/uv/releases/download/0.11.2"
423434
artifacts
424435
uv-aarch64-apple-darwin.tar.gz
425436
name "uv-aarch64-apple-darwin.tar.gz"
@@ -460,6 +471,14 @@ def _get_tool_urls_from_dist_manifest(module_ctx, *, base_url, manifest_filename
460471
fail(result)
461472
dist_manifest = json.decode(module_ctx.read(dist_manifest))
462473

474+
base_url = (
475+
dist_manifest
476+
.get("releases", [{}])[0]
477+
.get("hosting", {})
478+
.get("simple", {})
479+
.get("download_url", base_url)
480+
)
481+
463482
artifacts = dist_manifest["artifacts"]
464483
tool_sources = {}
465484
downloads = {}

0 commit comments

Comments
 (0)