Skip to content

Commit 8f46464

Browse files
authored
Merge pull request #91 from rjmalves/feat/infra-docs-overhaul
feat: infrastructure & documentation overhaul
2 parents 2705c45 + e1c1f5e commit 8f46464

File tree

106 files changed

+4008
-2826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4008
-2826
lines changed

.github/workflows/docs.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ on:
44
branches:
55
- main
66
workflow_dispatch:
7-
7+
8+
permissions:
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
15+
816
jobs:
9-
docs:
17+
build:
1018
runs-on: ubuntu-latest
1119
steps:
1220
- uses: actions/checkout@v4
@@ -16,18 +24,23 @@ jobs:
1624
run: uv python install
1725
- name: Install the project
1826
run: |
19-
uv sync --all-extras --dev
20-
- name: Runs tests
21-
run: |
22-
uv run pytest ./tests
27+
uv sync --extra docs
2328
- name: Sphinx build
2429
run: |
2530
uv run sphinx-build -M html docs/source docs/build
26-
- name: Deploy
27-
uses: peaceiris/actions-gh-pages@v3
28-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
31+
- name: Upload Pages artifact
32+
uses: actions/upload-pages-artifact@v3
2933
with:
30-
publish_branch: gh-pages
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
publish_dir: docs/build/html
33-
force_orphan: true
34+
path: docs/build/html
35+
36+
deploy:
37+
needs: build
38+
if: github.event_name == 'push' || github.ref == 'refs/heads/main'
39+
runs-on: ubuntu-latest
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

.github/workflows/main.yml

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,49 @@ on:
99
- main
1010

1111
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v3
18+
- name: Set up Python 3.12
19+
run: uv python install 3.12
20+
- name: Install the project
21+
run: uv sync --extra lint
22+
- name: Ruff check
23+
run: uv run ruff check ./idecomp
24+
- name: Ruff format check
25+
run: uv run ruff format --check ./idecomp
26+
27+
typecheck:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v3
33+
- name: Set up Python 3.12
34+
run: uv python install 3.12
35+
- name: Install the project
36+
run: uv sync --extra lint
37+
- name: Static type check
38+
run: uv run mypy ./idecomp
39+
1240
test:
1341
runs-on: ubuntu-latest
1442
strategy:
1543
matrix:
16-
python-version: ["3.10", "3.11", "3.12"]
44+
python-version: ["3.11", "3.12", "3.13", "3.14"]
1745
steps:
1846
- uses: actions/checkout@v4
1947
- name: Install uv
2048
uses: astral-sh/setup-uv@v3
2149
- name: Set up Python ${{ matrix.python-version }}
2250
run: uv python install ${{ matrix.python-version }}
2351
- name: Install the project
24-
run: |
25-
uv sync --all-extras --dev
26-
- name: Runs tests
27-
run: |
28-
uv run pytest --cov-report=xml --cov=idecomp ./tests
52+
run: uv sync --extra test
53+
- name: Run tests
54+
run: uv run pytest --cov-report=xml --cov=idecomp ./tests
2955
- uses: codecov/codecov-action@v4
3056
with:
3157
token: ${{ secrets.CODECOV_TOKEN }}
@@ -35,12 +61,16 @@ jobs:
3561
name: codecov-idecomp
3662
fail_ci_if_error: true
3763
verbose: true
38-
- name: Static type check
39-
run: |
40-
uv run mypy ./idecomp
41-
- name: Linter code check
42-
run: |
43-
uv run ruff check ./idecomp
64+
65+
docs:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- name: Install uv
70+
uses: astral-sh/setup-uv@v3
71+
- name: Set up Python 3.12
72+
run: uv python install 3.12
73+
- name: Install the project
74+
run: uv sync --extra docs
4475
- name: Sphinx build
45-
run: |
46-
uv run sphinx-build -M html docs/source docs/build
76+
run: uv run sphinx-build -b html -W --keep-going docs/source docs/build/html

.github/workflows/publish.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/idecomp
14+
permissions:
15+
id-token: write
16+
contents: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v3
21+
- name: Set up Python
22+
run: uv python install 3.12
23+
- name: Install the project
24+
run: uv sync --extra test --extra lint
25+
- name: Validate version
26+
run: |
27+
PKG_VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' idecomp/__init__.py)
28+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
29+
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
30+
echo "Version mismatch: __init__.py=$PKG_VERSION tag=$TAG_VERSION"
31+
exit 1
32+
fi
33+
- name: Run tests
34+
run: uv run pytest ./tests
35+
- name: Type check
36+
run: uv run mypy ./idecomp
37+
- name: Lint check
38+
run: uv run ruff check ./idecomp
39+
- name: Build package
40+
run: uv build
41+
- name: PyPI publish
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
- name: Create GitHub Release
44+
env:
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
run: |
47+
gh release create ${{ github.ref_name }} --generate-notes || echo "Release already exists"

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,10 @@ teste.py
141141
teste.txt
142142

143143
# UV
144-
uv.lock
144+
uv.lock
145+
146+
# Claude Code
147+
.claude/
148+
149+
# Implementation plans
150+
plans/

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.15.5
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format
8+
9+
- repo: local
10+
hooks:
11+
- id: mypy
12+
name: mypy
13+
entry: uv run --no-sync mypy ./idecomp
14+
language: system
15+
types: [python]
16+
pass_filenames: false
17+
stages: [pre-commit]

0 commit comments

Comments
 (0)