From 1217cd2b62c36c195cbc81e165a4fcf44927bf9b Mon Sep 17 00:00:00 2001 From: Preocts Date: Tue, 12 Aug 2025 00:29:51 -0400 Subject: [PATCH 1/5] Remove settings job Turns out the setup-python action already looks for and respects the `.python-version` pin. Easy mode. --- .github/workflows/python-tests.yml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 922b0a3..248b301 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -18,20 +18,8 @@ env: UV_PYTHON_PREFERENCE: "only-system" jobs: - settings: - runs-on: "ubuntu-latest" - name: "Define workflow settings" - steps: - - name: "Repo checkout" - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" - - - name: "Define settings" - run: | - echo "python_version=$(<.python-version)" >> $GITHUB_OUTPUT - run-tests-and-coverage: name: "Run nox for tests and coverage" - needs: "settings" runs-on: "${{ matrix.os }}" strategy: fail-fast: false @@ -54,14 +42,12 @@ jobs: - name: "Set up Python ${{ matrix.python-version }}" uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" with: - python-version: "${{ matrix.python-version }}" allow-prereleases: true - name: "Install the latest version of uv" uses: "astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc" with: version: "latest" - python-version: "${{ matrix.python-version }}" enable-cache: true - name: "Run tests and coverage via nox" @@ -77,7 +63,7 @@ jobs: coverage-compile: name: "coverage compile" - needs: ["settings", "run-tests-and-coverage"] + needs: "run-tests-and-coverage" runs-on: "ubuntu-latest" steps: - name: "Repo checkout" @@ -85,14 +71,11 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" - with: - python-version: ${{ steps.settings.outputs.python_version }} - name: "Install the latest version of uv" uses: "astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc" with: version: "latest" - python-version: ${{ steps.settings.outputs.python_version }} enable-cache: true - name: "Download coverage artifacts" @@ -117,7 +100,6 @@ jobs: linters-and-formatters: name: "linters and formatters" - needs: "settings" runs-on: "ubuntu-latest" steps: - name: "Repo checkout" @@ -125,14 +107,11 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" - with: - python-version: ${{ steps.settings.outputs.python_version }} - name: "Install the latest version of uv" uses: "astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc" with: version: "latest" - python-version: ${{ steps.settings.outputs.python_version }} enable-cache: true - name: "Run linters and formatters" From 173a7f93b231097e6afd3fff8e20e721d69c5983 Mon Sep 17 00:00:00 2001 From: Preocts Date: Tue, 12 Aug 2025 00:38:42 -0400 Subject: [PATCH 2/5] Use correct python version --- .github/workflows/python-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 248b301..053af86 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -48,6 +48,7 @@ jobs: uses: "astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc" with: version: "latest" + python-version: "${{ matrix.python-version }}" enable-cache: true - name: "Run tests and coverage via nox" From d2313006ae23ffb7dc8f044147ab73955ece4c53 Mon Sep 17 00:00:00 2001 From: Preocts Date: Tue, 12 Aug 2025 00:39:49 -0400 Subject: [PATCH 3/5] Remove python-setup --- .github/workflows/python-tests.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 053af86..c1a6170 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -1,6 +1,5 @@ name: "python tests and coverage" # Uses: -# https://github.com/actions/setup-python : v5.6.0 a26af69be951a213d495a4c3e4e4022e16d87065 # https://github.com/actions/checkout : v4.2.2 11bd71901bbe5b1630ceea73d27597364c9af683 # https://github.com/actions/download-artifact : v5.0.0 634f93cb2916e3fdff6788551b99b062d0335ce0 # https://github.com/actions/upload-artifact : v4.6.2 ea165f8d65b6e75b540449e92b4886f43607fa02 @@ -39,11 +38,6 @@ jobs: - name: "Repo checkout" uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" - - name: "Set up Python ${{ matrix.python-version }}" - uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" - with: - allow-prereleases: true - - name: "Install the latest version of uv" uses: "astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc" with: @@ -70,9 +64,6 @@ jobs: - name: "Repo checkout" uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" - - name: "Set up Python" - uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" - - name: "Install the latest version of uv" uses: "astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc" with: @@ -106,9 +97,6 @@ jobs: - name: "Repo checkout" uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" - - name: "Set up Python" - uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" - - name: "Install the latest version of uv" uses: "astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc" with: From c7797481cd8a4451f710e3fe3deeed45f61206fe Mon Sep 17 00:00:00 2001 From: Preocts Date: Tue, 12 Aug 2025 00:41:49 -0400 Subject: [PATCH 4/5] Remove only system flag --- .github/workflows/python-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index c1a6170..edc174e 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -13,9 +13,6 @@ on: branches: - "main" -env: - UV_PYTHON_PREFERENCE: "only-system" - jobs: run-tests-and-coverage: name: "Run nox for tests and coverage" From 7f1b08d9fa4c265d6de4f3447c5a06a907620c91 Mon Sep 17 00:00:00 2001 From: Preocts Date: Tue, 12 Aug 2025 00:47:42 -0400 Subject: [PATCH 5/5] no-config parameter is not needed --- .github/workflows/python-tests.yml | 2 +- noxfile.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index edc174e..6d6cf15 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -43,7 +43,7 @@ jobs: enable-cache: true - name: "Run tests and coverage via nox" - run: "uvx nox --session test -- partial-coverage no-config" + run: "uvx nox --session test -- partial-coverage" - name: "Save coverage artifact" uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02" diff --git a/noxfile.py b/noxfile.py index adc4c44..aed306b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -66,9 +66,6 @@ def run_tests_with_coverage(session: nox.Session) -> None: """Run pytest in isolated environment, display coverage. Extra arguements passed to pytest.""" partial = "partial-coverage" in session.posargs extra: list[str] = [] - if "no-config" in session.posargs: - session.posargs.remove("no-config") - extra = ["--no-config"] session.run_install("uv", "sync", *SYNC_ARGS, *extra)