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
8 changes: 4 additions & 4 deletions scripts/update_uv_build_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import httpx
from packaging.utils import parse_wheel_filename
from packaging.version import Version


def main():
Expand All @@ -34,13 +33,14 @@ def main():
[major, minor, _patch] = current_release.release
if major != 0:
raise NotImplementedError("The script needs to be updated for uv 1.x")
upper_bound = Version(f"{major}.{minor + 1}.0")
lower_bound = f"{major}.{minor}"
upper_bound = f"{major}.{minor + 1}"

repository_root = Path(__file__).parent.parent
existing = repository_root.joinpath(
"source/shared/build-backend-tabs.rst"
).read_text()
replacement = f'requires = ["uv_build >= {current_release}, <{upper_bound}"]'
replacement = f'requires = ["uv_build >= {lower_bound}, <{upper_bound}"]'
searcher = re.compile(re.escape('requires = ["uv_build') + ".*" + re.escape('"]'))
if not searcher.search(existing):
raise RuntimeError("Could not `uv-build` entry")
Expand All @@ -51,7 +51,7 @@ def main():
Path("source/shared/build-backend-tabs.rst").write_text(updated)
if github_output := os.environ.get("GITHUB_OUTPUT"):
with open(github_output, "a") as f:
f.write(f"version={current_release}\n")
f.write(f"version={lower_bound}\n")
f.write("updated=true\n")
else:
print("Already up-to-date source/shared/build-backend-tabs.rst")
Expand Down
2 changes: 1 addition & 1 deletion source/shared/build-backend-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
.. code-block:: toml

[build-system]
requires = ["uv_build >= 0.13.6, <0.14.0"]
requires = ["uv_build >= 0.13, <0.14"]
build-backend = "uv_build"
Loading