Skip to content

Commit

Permalink
Use pipx to run nox / build in GHA workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Mar 19, 2022
1 parent 85ff971 commit 8200b41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/docs.yml
Expand Up @@ -28,10 +28,5 @@ jobs:
python-version: "3.9"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade nox
- name: Build documentation
run: python -m nox --error-on-missing-interpreters -s docs
run: pipx run nox --error-on-missing-interpreters -s docs
18 changes: 2 additions & 16 deletions .github/workflows/lint.yml
Expand Up @@ -28,13 +28,8 @@ jobs:
python-version: "3.9"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade nox
- name: Run `nox -s lint`
run: python -m nox --error-on-missing-interpreters -s lint
run: pipx run nox --error-on-missing-interpreters -s lint

build:
name: Build sdist and wheel
Expand All @@ -48,17 +43,8 @@ jobs:
steps:
- uses: actions/checkout@v1

- uses: actions/setup-python@v3
name: Install Python
with:
python-version: "3.9"
cache: 'pip'

- name: Install dependencies
run: python -m pip install --upgrade build

- name: Build
run: pyproject-build
run: pipx run build

- name: Archive files
uses: actions/upload-artifact@v1
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/test.yml
Expand Up @@ -34,12 +34,6 @@ jobs:
python-version: ${{ matrix.python_version }}
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox
shell: bash

# PyPy 3.9 for Windows changed the binary name from pypy3 to pypy3.9
# PyPy 3.7 & 3.8 for Windows still only have pypy3
# https://foss.heptapod.net/pypy/pypy/-/commit/f15239a703325d97ca4fa655d00f3c05f58bd8be adds back pypy3 on 3.9
Expand All @@ -55,14 +49,10 @@ jobs:
if: ${{ (matrix.os == 'Windows') && (matrix.python_version == 'pypy-3.9') }}

- name: Run nox
run: |
python -m nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }}
shell: bash
run: pipx run nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }}
if: ${{ ! startsWith( matrix.python_version, 'pypy' ) }}

# Binary is named 'pypy3', but setup-python specifies it as 'pypy-3.x'.
- name: Run nox for pypy3
run: |
python -m nox --error-on-missing-interpreters -s tests-pypy3
shell: bash
run: pipx run nox --error-on-missing-interpreters -s tests-pypy3
if: ${{ startsWith( matrix.python_version, 'pypy' ) }}

0 comments on commit 8200b41

Please sign in to comment.