Skip to content

Commit c1250a0

Browse files
committed
build: drop py3.8
1 parent 6fe19e3 commit c1250a0

File tree

5 files changed

+2032
-304
lines changed

5 files changed

+2032
-304
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,55 @@ env:
2020
FORCE_COLOR: 3
2121

2222
jobs:
23-
pre-commit:
23+
format:
2424
name: Format
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28-
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
29-
with:
30-
python-version: "3.x"
31-
# - uses: pre-commit/action@v3.0.1
32-
# with:
33-
# extra_args: --hook-stage manual --all-files
34-
- name: Run PyLint
35-
run: pipx run nox -s pylint -- --output-format=github
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
30+
- name: Install
31+
run: uv sync --no-default-groups --group nox --group lint --locked
32+
- name: Lint
33+
run: uv run --frozen nox -s lint
3634

37-
checks:
35+
tests:
3836
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
3937
runs-on: ${{ matrix.runs-on }}
40-
needs: [pre-commit]
38+
needs: [format]
4139
strategy:
4240
fail-fast: false
4341
matrix:
44-
python-version: ["3.8", "3.13"]
42+
python-version: ["3.9", "3.13"]
4543
runs-on: [ubuntu-latest, windows-latest, macos-latest]
4644

4745
steps:
4846
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
49-
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
47+
48+
- name: Install uv
49+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
5050
with:
5151
python-version: ${{ matrix.python-version }}
52-
allow-prereleases: true
5352

54-
- name: Install package
55-
run: python -m pip install .[test]
53+
- name: Install
54+
run: uv sync --no-default-groups --group nox --group test --locked
5655

5756
- name: Test package
58-
run: >-
59-
python -m pytest -ra --cov --cov-report=xml --cov-report=term
60-
--durations=20
57+
run: |
58+
uv run --frozen nox -s test -- --cov --cov-report=xml --cov-report=term --durations=20
6159
6260
- name: Upload coverage report
6361
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
6462
with:
6563
token: ${{ secrets.CODECOV_TOKEN }}
64+
65+
status:
66+
name: CI Pass
67+
runs-on: ubuntu-latest
68+
needs: [format, tests]
69+
if: always()
70+
steps:
71+
- name: All required jobs passed
72+
uses: re-actors/alls-green@release/v1
73+
with:
74+
jobs: ${{ toJSON(needs) }}

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ repos:
6262
rev: "v2.4.1"
6363
hooks:
6464
- id: codespell
65+
args: ["--toml", "pyproject.toml"]
66+
additional_dependencies: ["tomli"]
6567

6668
- repo: local
6769
hooks:

noxfile.py

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,65 @@
1-
"""Nox configuration."""
1+
"""Nox setup."""
22

33
import shutil
44
from pathlib import Path
55

66
import nox
7+
from nox_uv import session
8+
9+
nox.needs_version = ">=2024.3.2"
10+
nox.options.default_venv_backend = "uv"
711

812
DIR = Path(__file__).parent.resolve()
913

10-
nox.needs_version = ">=2024.3.2"
11-
nox.options.sessions = ["lint", "pylint", "tests"]
12-
nox.options.default_venv_backend = "uv|virtualenv"
14+
# =============================================================================
15+
# Linting
1316

1417

15-
@nox.session
16-
def lint(session: nox.Session) -> None:
18+
@session(uv_groups=["lint"], reuse_venv=True)
19+
def lint(s: nox.Session, /) -> None:
1720
"""Run the linter."""
18-
session.install("pre-commit")
19-
session.run(
20-
"pre-commit",
21-
"run",
22-
"--all-files",
23-
"--show-diff-on-failure",
24-
*session.posargs,
25-
)
26-
27-
28-
@nox.session
29-
def pylint(session: nox.Session) -> None:
21+
s.notify("precommit")
22+
s.notify("pylint")
23+
24+
25+
@session(uv_groups=["lint"], reuse_venv=True)
26+
def precommit(s: nox.Session, /) -> None:
27+
"""Run pre-commit."""
28+
s.run("pre-commit", "run", "--all-files", *s.posargs)
29+
30+
31+
@session(uv_groups=["lint"], reuse_venv=True)
32+
def pylint(s: nox.Session, /) -> None:
3033
"""Run PyLint."""
31-
# This needs to be installed into the package environment, and is slower
32-
# than a pre-commit check
33-
session.install(".", "pylint>=3.2")
34-
session.run("pylint", "plotting_backends", *session.posargs)
34+
s.install(".", "pylint>=3.2")
35+
s.run("pylint", "plotting_backends", *s.posargs)
3536

3637

37-
@nox.session
38-
def tests(session: nox.Session) -> None:
38+
# =============================================================================
39+
# Testing
40+
41+
42+
@session(uv_groups=["test"], reuse_venv=True)
43+
def test(s: nox.Session, /) -> None:
3944
"""Run the unit and regular tests."""
40-
session.install(".[test]")
41-
session.run("pytest", *session.posargs)
45+
s.notify("pytest", posargs=s.posargs)
46+
47+
48+
@session(uv_groups=["test"], reuse_venv=True)
49+
def pytest(s: nox.Session, /) -> None:
50+
"""Run the unit and regular tests."""
51+
s.run("pytest", *s.posargs)
52+
53+
54+
# =============================================================================
55+
# Build
4256

4357

44-
@nox.session
45-
def build(session: nox.Session) -> None:
58+
@session(uv_groups=["build"])
59+
def build(s: nox.Session, /) -> None:
4660
"""Build an SDist and wheel."""
4761
build_path = DIR.joinpath("build")
4862
if build_path.exists():
4963
shutil.rmtree(build_path)
5064

51-
session.install("build")
52-
session.run("python", "-m", "build")
65+
s.run("python", "-m", "build")

pyproject.toml

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ authors = [
1212
description = "Plotting dispatch backends"
1313
readme = "README.md"
1414
license.file = "LICENSE"
15-
requires-python = ">=3.8"
15+
requires-python = ">=3.9"
1616
classifiers = [
1717
"Development Status :: 1 - Planning",
1818
"Intended Audience :: Science/Research",
@@ -22,7 +22,6 @@ classifiers = [
2222
"Programming Language :: Python",
2323
"Programming Language :: Python :: 3",
2424
"Programming Language :: Python :: 3 :: Only",
25-
"Programming Language :: Python :: 3.8",
2625
"Programming Language :: Python :: 3.9",
2726
"Programming Language :: Python :: 3.10",
2827
"Programming Language :: Python :: 3.11",
@@ -34,36 +33,47 @@ classifiers = [
3433
dynamic = ["version"]
3534
dependencies = []
3635

37-
[project.optional-dependencies]
38-
test = [
39-
"pytest >=6",
40-
"pytest-cov >=3",
41-
"sybil != 7.1.0",
42-
]
43-
dev = [
44-
"plotting_backends[test]",
45-
]
46-
4736
[project.urls]
4837
Homepage = "https://github.com/GalacticDynamics/plotting_backends"
4938
"Bug Tracker" = "https://github.com/GalacticDynamics/plotting_backends/issues"
5039
Changelog = "https://github.com/GalacticDynamics/plotting_backends/releases"
5140

5241

42+
[dependency-groups]
43+
dev = [
44+
"cz-conventional-gitmoji>=0.6.1",
45+
"ipykernel>=6.29.5",
46+
{ include-group = "build" },
47+
{ include-group = "lint" },
48+
{ include-group = "nox" },
49+
{ include-group = "test" },
50+
]
51+
build = [
52+
"build>=1.3.0",
53+
]
54+
lint = [
55+
"mypy>=1.19.0",
56+
"pre-commit>=3.5.0",
57+
"pylint>=3.3.9",
58+
]
59+
nox = [
60+
"nox>=2025.11.12",
61+
"nox-uv>=0.6.3",
62+
]
63+
test = [
64+
"pytest>=8.4.1",
65+
"pytest-cov>=6.2.1",
66+
"sybil[pytest]>=9.1.0",
67+
]
68+
69+
5370
[tool.hatch]
5471
version.source = "vcs"
5572
build.hooks.vcs.version-file = "src/plotting_backends/_version.py"
5673

5774

58-
[tool.pytest.ini_options]
59-
minversion = "8.0"
60-
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
61-
xfail_strict = true
62-
filterwarnings = [
63-
"error",
64-
]
65-
log_cli_level = "INFO"
66-
testpaths = ["tests/", "src/"]
75+
[tool.codespell]
76+
skip = ["uv.lock"]
6777

6878

6979
[tool.coverage]
@@ -77,7 +87,7 @@ report.exclude_also = [
7787
]
7888

7989
[tool.mypy]
80-
python_version = "3.8"
90+
python_version = "3.9"
8191

8292
disallow_incomplete_defs = true
8393
disallow_untyped_defs = true
@@ -100,6 +110,17 @@ module = "plotting_backends.*"
100110
disable_error_code = ["name-defined"] # <- jaxtyping
101111

102112

113+
[tool.pytest.ini_options]
114+
minversion = "8.0"
115+
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
116+
xfail_strict = true
117+
filterwarnings = [
118+
"error",
119+
]
120+
log_cli_level = "INFO"
121+
testpaths = ["tests/", "src/"]
122+
123+
103124
[tool.ruff]
104125

105126
[tool.ruff.lint]
@@ -118,7 +139,7 @@ ignore = [
118139

119140

120141
[tool.pylint]
121-
py-version = "3.8"
142+
py-version = "3.9"
122143
ignore-paths = [".*/_version.py"]
123144
reports.output-format = "colorized"
124145
similarities.ignore-imports = "yes"

0 commit comments

Comments
 (0)