From 71a1d5e91de91f77b043561e63e8cf42f0fe5587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Houpert?= <10154151+lhoupert@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:14:29 +0100 Subject: [PATCH 1/4] fix: use hatch's `default` env so the uv installer is inherited MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `[tool.hatch.envs.defaults]` (plural) is a standalone environment that nothing inherits from — hatch's base environment is `default` (singular). As written, `installer = "uv"` never applied to `test`, `docs`, etc., so those envs fell back to the `virtualenv` backend. This breaks contributors whose Python is uv-managed: hatch hands the `~/.local/bin/pythonX.Y` symlink to virtualenv, which mis-relocates the python-build-standalone interpreter (`sys.base_prefix = '/install'`, `ModuleNotFoundError: No module named 'encodings'`). Creating the env with `uv venv` relocates it correctly. Renaming to `default` makes the intended uv installer apply to all envs. Co-Authored-By: Claude Opus 4.8 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e342e8305c..81a4461978 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -257,7 +257,7 @@ extra-dependencies = [ 'obstore==0.5.*', ] -[tool.hatch.envs.defaults] +[tool.hatch.envs.default] installer = "uv" [tool.hatch.envs.docs] From 81d6fee5c229975e35d7d5027589d67c0617ab91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Houpert?= <10154151+lhoupert@users.noreply.github.com> Date: Mon, 1 Jun 2026 21:43:12 +0100 Subject: [PATCH 2/4] ci: install uv in hatch-based workflows so the uv installer works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Activating `installer = "uv"` (via the `default` env fix) means hatch now needs a uv binary to create/sync the test, gputest and hypothesis envs. These workflows install hatch via the `pypa/hatch` action (a pyapp build with its own bundled Python) but never set up uv, so hatch fell back to provisioning uv through its pyapp runtime — whose `pip` has a `python3.12` shebang that doesn't exist on non-3.12 runners: .../pyapp/hatch/.../python/bin/python3.12: No such file or directory Process completed with exit code 126 Add the repo's standard `astral-sh/setup-uv` step (already used by docs/lint workflows) before "Install Hatch" so hatch finds uv on PATH and uses it directly. With uv available, `uv venv --python ` selects the correct interpreter, so the root `.python-version` (3.12, for the dev env) no longer interferes with the 3.13/3.14 matrix envs. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/gpu_test.yml | 2 ++ .github/workflows/hypothesis.yaml | 2 ++ .github/workflows/test.yml | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/gpu_test.yml b/.github/workflows/gpu_test.yml index 333769cb9e..513ba7fd31 100644 --- a/.github/workflows/gpu_test.yml +++ b/.github/workflows/gpu_test.yml @@ -59,6 +59,8 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index a456b2aa0a..0d40cf46bb 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -54,6 +54,8 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62e571856b..573c714b51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,6 +60,8 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: @@ -109,6 +111,8 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: @@ -144,6 +148,8 @@ jobs: with: python-version: '3.13' cache: 'pip' + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: @@ -168,6 +174,8 @@ jobs: with: python-version: '3.13' cache: 'pip' + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: From 0a198e5b6b111439ccd4beb7a86b9e657db55968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Houpert?= <10154151+lhoupert@users.noreply.github.com> Date: Mon, 1 Jun 2026 21:51:14 +0100 Subject: [PATCH 3/4] ci: point hatch at the setup-uv binary to skip its broken uv bootstrap Installing uv on PATH is not enough: hatch only skips provisioning its internal `hatch-uv` env when an explicit uv path is set. Otherwise it bootstraps uv via its bundled pyapp `pip` (shebang `python3.12`), which fails on non-3.12 runners with exit code 126. Set `HATCH_ENV_TYPE_VIRTUAL_UV_PATH=uv` so hatch uses the uv provided by astral-sh/setup-uv directly instead of bootstrapping. Verified locally: with the explicit path set, `hatch env create` succeeds. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/gpu_test.yml | 2 ++ .github/workflows/hypothesis.yaml | 2 ++ .github/workflows/test.yml | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/gpu_test.yml b/.github/workflows/gpu_test.yml index 513ba7fd31..c03318d649 100644 --- a/.github/workflows/gpu_test.yml +++ b/.github/workflows/gpu_test.yml @@ -12,6 +12,8 @@ on: env: LD_LIBRARY_PATH: /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64 + # Use the uv from astral-sh/setup-uv instead of hatch's bundled (pyapp) uv. + HATCH_ENV_TYPE_VIRTUAL_UV_PATH: uv permissions: contents: read diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index 0d40cf46bb..bc711c8490 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -18,6 +18,8 @@ concurrency: env: FORCE_COLOR: 3 + # Use the uv from astral-sh/setup-uv instead of hatch's bundled (pyapp) uv. + HATCH_ENV_TYPE_VIRTUAL_UV_PATH: uv jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 573c714b51..f3cfb535f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,11 @@ on: permissions: contents: read +env: + # Use the uv from astral-sh/setup-uv; without an explicit path hatch + # bootstraps its own (pyapp) uv, which fails on non-3.12 runners. + HATCH_ENV_TYPE_VIRTUAL_UV_PATH: uv + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From de4fd38255ed9ff32c78fc02d54aed280bbb6204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Houpert?= <10154151+lhoupert@users.noreply.github.com> Date: Mon, 1 Jun 2026 22:04:12 +0100 Subject: [PATCH 4/4] ci(test): install hatch via pip instead of the pyapp action The macOS jobs failed even with uv on PATH: hatch's pyapp (standalone) build on macOS has a `pip` whose shebang points at a non-existent `python3.12`, and activating the uv installer makes hatch invoke it (`exit code 126`). Linux pyapp builds are unaffected, which is why the GPU and Hypothesis (Linux) workflows pass. Install hatch with `python -m pip install hatch==1.16.5` (the method the contributing docs already document) so hatch runs on the runner's normal Python with a working pip on every OS. uv (from setup-uv) is still used as the env installer. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/test.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3cfb535f1..142290d109 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,9 +68,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch - uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc - with: - version: '1.16.5' + run: python -m pip install hatch==1.16.5 - name: Set Up Hatch Env env: HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }} @@ -119,9 +117,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch - uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc - with: - version: '1.16.5' + run: python -m pip install hatch==1.16.5 - name: Set Up Hatch Env env: HATCH_ENV: ${{ matrix.dependency-set }} @@ -156,9 +152,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch - uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc - with: - version: '1.16.5' + run: python -m pip install hatch==1.16.5 - name: Set Up Hatch Env run: | hatch run doctest:pip list @@ -182,9 +176,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - name: Install Hatch - uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc - with: - version: '1.16.5' + run: python -m pip install hatch==1.16.5 - name: Run Benchmarks run: | hatch env run --env "test.py3.13-minimal" run-benchmark