From e24b32da7a13520f26ad758595cdf7c5837da645 Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Date: Tue, 9 Dec 2025 21:56:43 +0100 Subject: [PATCH] pin python inside devcontainer When pinned outside via .python-version it will fail as soon as your system python does not match .python-version, which forces you to delete it or to install another python binary which isn't optimal. This pins python to 3.12 to match the devcontainer installed one. --- .devcontainer/Dockerfile | 2 -- .devcontainer/devcontainer.json | 2 +- .github/workflows/documentation.yaml | 8 ++++++-- .python-version | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .python-version diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c936e5825..2d14439da 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,7 +9,5 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv COPY --from=ghcr.io/astral-sh/uv:latest /uvx /bin/uvx COPY ./.python-version ./ -RUN uv python pin "$(cat .python-version)" - # Install required tools for development RUN apt-get update && apt-get install -y iperf3 libusb-dev \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 069c58406..7d041f647 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "dockerfile": "Dockerfile" }, "postCreateCommand": "make sync", - "postStartCommand": "uv run pre-commit install", + "postStartCommand": "uv python pin 3.12 && uv run pre-commit install", "remoteUser": "vscode", // Mount USB devices to devcontainer for tests "mounts": [ diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 6735c4838..75e9758d2 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -42,7 +42,9 @@ jobs: version: "latest" - name: Install Python - run: uv python install + run: | + uv python pin 3.12 + uv python install - name: Setup Pages id: pages @@ -80,7 +82,9 @@ jobs: version: "latest" - name: Install Python - run: uv python install + run: | + uv python pin 3.12 + uv python install - name: Build the documentation for the current version (no warnings allowed) run: make sync && make docs diff --git a/.python-version b/.python-version deleted file mode 100644 index fdcfcfdfc..000000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.12 \ No newline at end of file