Skip to content

Run the Python programs under uv; move bench-link.sh to Python - #402

Merged
lambdanature merged 1 commit into
mainfrom
389-scripts-under-uv
Nov 29, 2026
Merged

lambdanature merged 1 commit into
mainfrom
389-scripts-under-uv

Conversation

@lambdanature

Copy link
Copy Markdown
Contributor

First step of #389: what moving the scripts to Python run by uv needs, and the first program moved.

uv and Python

  • uv 0.13.8, the newest the pinned taiki-e/install-action knows. CI installs it with cargo-nextest in the same step, with fallback: none, in the Linux, macOS and Windows check jobs.
  • tools/dev-setup.sh reads the version from ci.yml, downloads uv's release binary and checks it against SHA-256s kept in the script (uv's .sha256 files). A newer uv will do. uv is required; on FreeBSD the script names the package. Never compiled.
  • Python is pinned to ==3.15.* in each program's inline script block (PEP 723). uv 0.13.8 knows 3.15.2.

The layout, and the first program

  • tools/bench-link.sh (A repeatable benchmark of irsync against rsync and tar|nc #388) is now tools/bench-link.py, with the stand-ins bench-link.sh and bench-link.cmd. Same commands, files and output as before; sessions are saved as session.json. What runs on the server stays sh, so the server needs no Python.
  • tools/tests/test_uv_programs.py: every tracked .py with the uv shebang has both stand-ins, exactly as expected, all pin the same Python, .cmd files have CRLF (.gitattributes), and each program answers --help.
  • On Windows, tools/ci.sh check runs each .cmd stand-in through cmd.exe with --help. This is its first run on real Windows.
  • tools/ci.sh check needs uv, and runs the tool tests with UV_TESTS_REQUIRED=1.

Installers under dash and bash

  • site/tools/test_install.py takes INSTALLER_TEST_SHELL, like packaging/tests/test_installer.py. release-tooling.yml runs both suites under dash and under bash, and now also runs when site/tools/test_install.py changes.

Docs: "The scripts" in book/src/contributing/setup.md, uv in its requirements (Windows too), and a Scripts rule in AGENTS.md.

Tests run locally: all of tools/tests (with uv required), the dev-setup tests (7 new for uv), the installer suites under dash and bash, tools/ci.sh workflows and shell-scripts. In the full tools/ci.sh check, two onboard_e2e tests timed out under a load average of 34 to 47 on the machine and pass alone; this PR changes no Rust. Not tested here: the uv download in dev-setup.sh with real files (only with a fake archive).

Part of #389; the later batches follow in their own pull requests.

The repository's shell scripts keep running into GNU and BSD
differences, bash 3.2 and pipefail, and do not run on Windows (#389).
This adds what the move needs and moves the first program:

- uv 0.13.8 in CI (install-action, next to cargo-nextest) and in
  tools/dev-setup.sh, which downloads it and checks its hash; Python is
  pinned to 3.15 in each program's inline script block.
- tools/bench-link.py, with the stand-ins bench-link.sh and
  bench-link.cmd; test_uv_programs.py holds every program to that
  layout, and the Windows check runs each .cmd stand-in.
- The installer tests run under both dash and bash in
  release-tooling.yml; the installers stay plain /bin/sh.
@lambdanature
lambdanature merged commit 8044350 into main Nov 29, 2026
20 checks passed
@lambdanature
lambdanature deleted the 389-scripts-under-uv branch November 29, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant