Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around pipx issue #1331 #285

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 22 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down