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

GitHub Actions pytest workflow now uses uv instead of nox #1370

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading