diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b17f407..e55fd0b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,8 +14,9 @@ jobs: include: - { python: "3.12", os: "ubuntu-latest", session: "pre-commit" } # - { python: "3.12", os: "ubuntu-latest", session: "mypy" } - - { python: "3.11", os: "ubuntu-latest", session: "tests" } - { python: "3.10", os: "ubuntu-latest", session: "tests" } + - { python: "3.11", os: "ubuntu-latest", session: "tests" } + - { python: "3.12", os: "ubuntu-latest", session: "tests" } - { python: "3.12", os: "windows-latest", session: "tests" } - { python: "3.12", os: "macos-latest", session: "tests" } - { python: "3.12", os: "ubuntu-latest", session: "xdoctest" } @@ -26,6 +27,18 @@ jobs: PRE_COMMIT_COLOR: "always" steps: + ############################### + # Work around pipx issue #1331 with absolute path to constraint.txt + # https://github.com/pypa/pipx/issues/1331#issuecomment-2043163012 + - name: Set PIP_ARGS on Windows + run: echo "PIP_ARGS=--constraint=$env:GITHUB_WORKSPACE/.github/workflows/constraints.txt" | Out-File -FilePath $env:GITHUB_ENV -Append + if: runner.os == 'Windows' + + - name: Set PIP_ARGS on not-Windows + run: echo "PIP_ARGS=--constraint=$GITHUB_WORKSPACE/.github/workflows/constraints.txt" >> "$GITHUB_ENV" + if: runner.os != 'Windows' + ############################### + - name: Check out the repository uses: actions/checkout@v4 @@ -36,7 +49,7 @@ jobs: - name: Upgrade pip run: | - pip install --constraint=.github/workflows/constraints.txt pip + pip install ${{ env.PIP_ARGS }} pip pip --version - name: Upgrade pip in virtual environments @@ -50,13 +63,13 @@ jobs: - name: Install Poetry run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry + pipx install --pip-args=${{ env.PIP_ARGS }} poetry poetry --version - name: Install Nox run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox - pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry + pipx install --pip-args=${{ env.PIP_ARGS }} nox + pipx inject --pip-args=${{ env.PIP_ARGS }} nox nox-poetry nox --version - name: Compute pre-commit cache key @@ -115,18 +128,18 @@ jobs: - name: Upgrade pip run: | - pip install --constraint=.github/workflows/constraints.txt pip + pip install ${{ env.PIP_ARGS }} pip pip --version - name: Install Poetry run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry + pipx install --pip-args=${{ env.PIP_ARGS }} poetry poetry --version - name: Install Nox run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox - pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry + pipx install --pip-args=${{ env.PIP_ARGS }} nox + pipx inject --pip-args=${{ env.PIP_ARGS }} nox nox-poetry nox --version - name: Download coverage data