Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ jobs:
- uses: actions/checkout@v6
- uses: jpetrucciani/mypy-check@master
with:
requirements: 1.6.0
python_version: 3.9
path: 'python/runfiles'
- uses: jpetrucciani/mypy-check@master
with:
requirements: 1.6.0
python_version: 3.9
path: 'tests/runfiles'
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ Other changes:
Fixes
([#3260](https://github.com/bazel-contrib/rules_python/issues/3260) and
[#2632](https://github.com/bazel-contrib/rules_python/issues/2632)).
* (uv) We will now use the download URL specified in the `uv`'s `dist_manifest.json`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filename mentioned here is dist_manifest.json, but the actual filename used in the repository and by the uv project is dist-manifest.json (with a hyphen).

Suggested change
* (uv) We will now use the download URL specified in the `uv`'s `dist_manifest.json`
* (uv) We will now use the download URL specified in the `uv`'s `dist-manifest.json`

file. If you have redirects or blocking rules as part of your downloader setup,
you may need to adjust them. What is more, the default uv version has been bumped
`0.11.2`.
Comment on lines +86 to +87
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a missing word "to" before the version number.

Suggested change
you may need to adjust them. What is more, the default uv version has been bumped
`0.11.2`.
you may need to adjust them. What is more, the default uv version has been bumped
to `0.11.2`.

* (runfiles): We are stopping the type annotation testing with `mypy` for Python 3.9.

{#v0-0-0-fixed}
### Fixed
Expand All @@ -97,6 +102,19 @@ Other changes:
* (bootstrap) Fixed incorrect runfiles path construction in bootstrap
scripts when binary is defined in another bazel module
([#3563](https://github.com/bazel-contrib/rules_python/issues/3563)).
* (uv) Downloads for versions `>=0.10` work again. In order to fix this we had
drop support for `powerpc64` platform. People interested in the platform can
Comment on lines +105 to +106
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a missing word "to" before "drop".

Suggested change
* (uv) Downloads for versions `>=0.10` work again. In order to fix this we had
drop support for `powerpc64` platform. People interested in the platform can
* (uv) Downloads for versions `>=0.10` work again. In order to fix this we had to
drop support for `powerpc64` platform. People interested in the platform can

bring it back via the `uv.default` API. Like:
```
uv.default(
compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:ppc",
],
platform = "powerpc64-unknown-linux-gnu",
)
```
Fixes [#3676](https://github.com/bazel-contrib/rules_python/issues/3676).

{#v0-0-0-added}
### Added
Expand Down
11 changes: 2 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ uv = use_extension("//python/uv:uv.bzl", "uv")
uv.default(
base_url = "https://github.com/astral-sh/uv/releases/download",
manifest_filename = "dist-manifest.json",
version = "0.6.3",
version = "0.11.2",
)
uv.default(
compatible_with = [
Expand All @@ -401,13 +401,6 @@ uv.default(
],
platform = "aarch64-unknown-linux-gnu",
)
uv.default(
compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:ppc",
],
platform = "powerpc64-unknown-linux-gnu",
)
uv.default(
compatible_with = [
"@platforms//os:linux",
Expand Down Expand Up @@ -460,7 +453,7 @@ uv_dev = use_extension(
dev_dependency = True,
)
uv_dev.configure(
version = "0.6.2",
version = "0.11.2",
)

# Temporarily comment out these flag aliases because they break Bazel 9
Expand Down
19 changes: 19 additions & 0 deletions python/uv/private/uv.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,17 @@ def _get_tool_urls_from_dist_manifest(module_ctx, *, base_url, manifest_filename
"uv-aarch64-apple-darwin.tar.gz.sha256"
"...
]
hosting
order
0 "simple"
1 "github"
github
artifact_base_url "https://github.com"
artifact_download_path "/astral-sh/uv/releases/download/0.11.2"
owner "astral-sh"
repo "uv"
simple
download_url "https://releases.astral.sh/github/uv/releases/download/0.11.2"
artifacts
uv-aarch64-apple-darwin.tar.gz
name "uv-aarch64-apple-darwin.tar.gz"
Expand Down Expand Up @@ -460,6 +471,14 @@ def _get_tool_urls_from_dist_manifest(module_ctx, *, base_url, manifest_filename
fail(result)
dist_manifest = json.decode(module_ctx.read(dist_manifest))

base_url = (
dist_manifest
.get("releases", [{}])[0]
.get("hosting", {})
.get("simple", {})
.get("download_url", base_url)
)
Comment on lines +474 to +480
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation will raise an IndexError if the releases key exists in the manifest but is an empty list (e.g., {"releases": []}). It is safer to check if the list is non-empty before attempting to access the first element.

    releases = dist_manifest.get("releases")
    if releases:
        base_url = releases[0].get("hosting", {}).get("simple", {}).get("download_url", base_url)


artifacts = dist_manifest["artifacts"]
tool_sources = {}
downloads = {}
Expand Down