Skip to content

Commit 2f50f7d

Browse files
authored
Update CI + packaging a bit (#74)
* Combine pytest.ini and setup.cfg into pyproject.toml * Modernize pyproject.toml to Poetry 2 * Merge CI workflows; use uv; add package build * Upgrade dev dependencies * Don't support EOL Python 3.8 * Track test coverage in CI
1 parent 1c9c336 commit 2f50f7d

File tree

6 files changed

+65
-64
lines changed

6 files changed

+65
-64
lines changed

.github/workflows/ci.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
unit-test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: astral-sh/[email protected]
19+
with:
20+
python-version: '3.12'
21+
- run: uvx poetry install
22+
- run: uvx poetry run pytest -v -ra --cov --cov-report=term-missing
23+
env:
24+
COVERAGE_CORE: sysmon
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: astral-sh/[email protected]
30+
with:
31+
python-version: '3.12'
32+
- run: uv build .
33+
- uses: actions/upload-artifact@v4
34+
with:
35+
name: dist
36+
path: dist
37+
ruff:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: astral-sh/ruff-action@v3
42+
- run: ruff check
43+
- run: ruff format --check

.github/workflows/pytest.yml

-28
This file was deleted.

.github/workflows/ruff.yml

-18
This file was deleted.

pyproject.toml

+22-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
[tool.poetry]
1+
[build-system]
2+
requires = ["poetry-core>=2.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
5+
[project]
26
name = "inertia-django"
37
version = "1.2.0"
48
description = "Django adapter for the InertiaJS framework"
5-
authors = ["Brandon Shar <[email protected]>"]
9+
authors = [{name="Brandon Shar", email="[email protected]"}]
610
license = "MIT"
11+
requires-python = ">=3.9"
712
readme = "README.md"
813
repository = "https://github.com/inertiajs/inertia-django"
914
homepage = "https://github.com/inertiajs/inertia-django"
@@ -15,23 +20,21 @@ classifiers = [
1520
"Framework :: Django :: 4",
1621
"Topic :: Software Development :: Libraries :: Python Modules",
1722
]
23+
dependencies = [
24+
"django>=4",
25+
"requests>=2",
26+
]
27+
28+
[tool.poetry]
1829
packages = [
1930
{ include = "inertia" },
2031
]
2132

22-
[tool.poetry.dependencies]
23-
python = "^3.8"
24-
django = ">=4"
25-
requests = "^2"
26-
27-
[tool.poetry.dev-dependencies]
28-
pytest = "^7.1.2"
29-
pytest-django = "^4.5.2"
30-
ruff = "^0.8.6"
31-
32-
[build-system]
33-
requires = ["poetry-core>=1.0.0"]
34-
build-backend = "poetry.core.masonry.api"
33+
[tool.poetry.group.dev.dependencies]
34+
pytest = "^8.3.5"
35+
pytest-cov = "^6.0.0"
36+
pytest-django = "^4.10.0"
37+
ruff = "^0.11.2"
3538

3639
[tool.ruff.lint]
3740
select = [
@@ -44,3 +47,7 @@ select = [
4447
]
4548
ignore = ["E501"] # line too long, formatter will handle this
4649
unfixable = ["B", "SIM"]
50+
51+
[tool.pytest.ini_options]
52+
DJANGO_SETTINGS_MODULE = "inertia.tests.settings"
53+
django_find_project = false

pytest.ini

-3
This file was deleted.

setup.cfg

Whitespace-only changes.

0 commit comments

Comments
 (0)