Skip to content

Commit

Permalink
GitHub Actions pytest workflow now uses uv instead of nox (#1370)
Browse files Browse the repository at this point in the history
GitHub Actions pytest workflow now uses uv instead of nox
  • Loading branch information
tleonhardt authored Nov 5, 2024
1 parent 9fc5683 commit c4a8d0e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 49 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,36 @@
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: "build"

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4 # https://github.com/actions/checkout
- uses: actions/checkout@v4 # https://github.com/actions/checkout
with:
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
# Set fetch-depth: 0 to fetch all history for all branches and tags.
fetch-depth: 0 # Needed for setuptools_scm to work correctly
- uses: actions/setup-python@v5 # https://github.com/actions/setup-python
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools setuptools-scm nox
- name: Run tests and post coverage results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python -m nox --non-interactive --session tests-${{ matrix.python-version }} # Run nox for a single version of Python

- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
run: uv run inv pytest --junit --no-pty --base

- name: Run isolated tests
run: uv run inv pytest --junit --no-pty --isolated
25 changes: 0 additions & 25 deletions noxfile.py

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ dev = [
"doc8",
"invoke",
"mypy",
"nox",
"pytest",
"pytest-cov",
"pytest-mock",
Expand Down
13 changes: 1 addition & 12 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def rmrf(items, verbose=True):

#####
#
# pytest, nox, pylint, and codecov
# pytest, pylint, and codecov
#
#####

Expand Down Expand Up @@ -117,17 +117,6 @@ def mypy_clean(context):
namespace_clean.add_task(mypy_clean, 'mypy')


@invoke.task
def nox_clean(context):
"""Remove nox virtualenvs and logs"""
# pylint: disable=unused-argument
with context.cd(TASK_ROOT_STR):
rmrf('.nox')


namespace_clean.add_task(nox_clean, 'nox')


#####
#
# documentation
Expand Down

0 comments on commit c4a8d0e

Please sign in to comment.