Skip to content

Commit d7ce9f5

Browse files
authored
Modernize (#134)
* Remove references to removed DevContainer configs Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Make sure all CI workflows set permissions explicitly Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Move to modern dependency group syntax Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Move away from darbiadev pre-built workflows Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Modernize docs workflow Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Upgrade dependencies Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Dependabot: Move Python deps to uv package-ecosystem Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Switch from pre-commit to prek Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Fix ReadTheDocs build config path Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * CI: fix command invocation Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * CI: Fixup dependency installation in Codspeed workflow Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Drop Python 3.9 support, add coverage to tests dependencies Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * CI: fix command invocation CodSpeed workflow Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * Docs: fix autoapi path Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * RtD: install deps from group instead of extra Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> * RtD: install self Signed-off-by: GitHub <noreply@github.com> --------- Signed-off-by: Bradley Reynolds <bradley.reynolds@tailstory.dev> Signed-off-by: GitHub <noreply@github.com>
1 parent 552fee1 commit d7ce9f5

File tree

16 files changed

+992
-738
lines changed

16 files changed

+992
-738
lines changed

.github/dependabot.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "devcontainers"
4-
directory: "/"
5-
schedule:
6-
interval: "monthly"
7-
83
- package-ecosystem: "github-actions"
94
directory: "/"
105
schedule:
@@ -14,7 +9,7 @@ updates:
149
patterns:
1510
- "*"
1611

17-
- package-ecosystem: "pip"
12+
- package-ecosystem: "uv"
1813
directory: "/"
1914
schedule:
2015
interval: "monthly"

.github/workflows/codspeed.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,23 @@ jobs:
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
with:
21+
persist-credentials: false
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
25+
with:
26+
enable-cache: true
2027

2128
- name: Setup Python
2229
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2330
with:
24-
python-version: 3.13
25-
cache: pip
26-
cache-dependency-path: uv.lock
27-
28-
- name: Update packaging tools
29-
run: python -m pip install --upgrade pip wheel setuptools build
31+
python-version-file: "pyproject.toml"
3032

31-
- name: Install dependencies
32-
run: python -m pip install .[tests]
33+
- name: Sync dependencies
34+
run: uv sync --group tests
3335

3436
- uses: CodSpeedHQ/action@0700edb451d0e9f2426f99bd6977027e550fb2a6 # v4.7.0
3537
with:
36-
run: pytest tests/ --codspeed
38+
run: uv run pytest tests/ --codspeed
3739
mode: "simulation"

.github/workflows/dependency-review.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Dependency Review'
1+
name: Dependency Review
22

33
on: [ pull_request ]
44

@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: 'Checkout Repository'
13+
- name: Checkout Repository
1414
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1515

16-
- name: 'Dependency Review'
16+
- name: Dependency Review
1717
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
1818
with:
1919
config-file: darbiadev/.github/.github/dependency-review-config.yaml@a5bf74504f1a843e026621c41517952fa3a09f81

.github/workflows/docs.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19+
with:
20+
persist-credentials: false
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
24+
with:
25+
enable-cache: true
26+
27+
- name: Setup Python
28+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
29+
with:
30+
python-version-file: "pyproject.toml"
31+
32+
- name: Sync dependencies
33+
run: uv sync --group docs
34+
35+
- name: Build docs
36+
run: uv run sphinx-build --builder dirhtml --nitpicky docs site
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
40+
with:
41+
path: ./site
42+
43+
deploy:
44+
if: ${{ github.ref == 'refs/heads/main' }}
45+
46+
permissions:
47+
contents: read
48+
pages: write
49+
id-token: write
50+
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
55+
runs-on: ubuntu-latest
56+
57+
needs: build
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/python-ci.yaml

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,63 @@
1-
name: "Python CI"
1+
name: Python CI
22

33
on:
44
push:
55
branches:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
id-token: write
12+
913
jobs:
10-
pre-commit:
11-
uses: darbiadev/.github/.github/workflows/generic-precommit.yaml@440166417b42442c6114aaa895094f0db7de9b78 # v15.2.0
12-
13-
lint:
14-
needs: pre-commit
15-
uses: darbiadev/.github/.github/workflows/python-lint.yaml@440166417b42442c6114aaa895094f0db7de9b78 # v15.2.0
16-
17-
test:
18-
needs: lint
19-
strategy:
20-
matrix:
21-
os: [ ubuntu-latest ]
22-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
23-
24-
uses: darbiadev/.github/.github/workflows/python-test.yaml@440166417b42442c6114aaa895094f0db7de9b78 # v15.2.0
25-
with:
26-
os: ${{ matrix.os }}
27-
python-version: ${{ matrix.python-version }}
28-
29-
docs:
30-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
31-
permissions:
32-
contents: read
33-
pages: write
34-
id-token: write
35-
36-
uses: darbiadev/.github/.github/workflows/github-pages-python-sphinx.yaml@440166417b42442c6114aaa895094f0db7de9b78 # v15.2.0
14+
lint-test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19+
with:
20+
persist-credentials: false
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
24+
with:
25+
enable-cache: true
26+
resolution-strategy: "lowest"
27+
28+
- name: Setup Python
29+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
30+
with:
31+
python-version-file: "pyproject.toml"
32+
33+
- name: Sync dependencies
34+
run: uv sync --group dev --group tests
35+
36+
- name: Run prek
37+
run: uv run prek run --all-files
38+
39+
- name: Check formatting
40+
run: uv run ruff format --check .
41+
42+
- name: Run Ruff checks
43+
run: uv run ruff check --output-format=github .
44+
45+
- name: Run mypy
46+
run: uv run mypy --strict src/ tests/
47+
48+
- name: Run tests
49+
run: uv run python -m coverage run -m pytest -v --junitxml=junit.xml
50+
51+
- name: Create coverage report
52+
run: uv run coverage xml
53+
54+
- name: Upload coverage reports to Codecov
55+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
56+
with:
57+
use_oidc: true
58+
59+
- name: Upload test results to Codecov
60+
if: ${{ !cancelled() }}
61+
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1
62+
with:
63+
use_oidc: true

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
44
hooks:
55
- id: check-case-conflict
66
- id: check-merge-conflict
@@ -12,4 +12,3 @@ repos:
1212
- id: mixed-line-ending
1313
args: [ --fix=lf ]
1414
- id: end-of-file-fixer
15-
exclude: .devcontainer/devcontainer-lock.json

docs/.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-lts-latest
5+
tools:
6+
python: "3"
7+
jobs:
8+
install:
9+
- pip install --upgrade pip
10+
- pip install --upgrade .
11+
- pip install --group 'docs'
12+
13+
sphinx:
14+
configuration: docs/conf.py

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
]
2727

2828
autoapi_type: str = "python"
29-
autoapi_dirs: list[str] = ["../../src"]
29+
autoapi_dirs: list[str] = ["../src"]
3030

3131
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
3232

0 commit comments

Comments
 (0)