From e77011e369ee22d67cde5770a69df012a3471672 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 5 Mar 2022 18:29:09 +0100 Subject: [PATCH] Use pipx to run nox / build in GHA workflows --- .github/workflows/docs.yml | 7 +------ .github/workflows/lint.yml | 17 ++--------------- .github/workflows/test.yml | 10 ++-------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1cfa6ecc9..6a48a1c2a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,10 +27,5 @@ jobs: with: python-version: '3.9' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade nox - - name: Build documentation - run: python -m nox -s docs + run: pipx run nox --error-on-missing-interpreters -s docs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b2c650ba2..370aeb570 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,13 +27,8 @@ jobs: with: python-version: "3.9" - - 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 -s lint + run: pipx run nox --error-on-missing-interpreters -s lint build: name: Build sdist and wheel @@ -47,16 +42,8 @@ jobs: steps: - uses: actions/checkout@v1 - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: "3.9" - - - 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0cb45cf23..03f98ef8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,12 +33,6 @@ jobs: with: python-version: ${{ matrix.python_version }} - - 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 @@ -55,13 +49,13 @@ jobs: - name: Run nox run: | - python -m nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }} + pipx run nox --error-on-missing-interpreters -s tests-${{ matrix.python_version }} shell: bash 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 + pipx run nox --error-on-missing-interpreters -s tests-pypy3 shell: bash if: ${{ startsWith( matrix.python_version, 'pypy' ) }}