-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refresh toolchain I've left this project to rot for ages, refreshing on top of uv.
- Loading branch information
1 parent
ec3cbbe
commit 5186652
Showing
36 changed files
with
2,221 additions
and
1,971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
max_line_length = 120 | ||
|
||
[*.json] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Setup Python Environment" | ||
description: "Set up Python environment for the given Python version" | ||
|
||
inputs: | ||
python-version: | ||
description: "Python version to use" | ||
required: true | ||
default: "3.12" | ||
uv-version: | ||
description: "uv version to use" | ||
required: true | ||
default: "0.4.6" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v2 | ||
with: | ||
version: ${{ inputs.uv-version }} | ||
enable-cache: "true" | ||
cache-suffix: ${{ matrix.python-version }} | ||
|
||
- name: Install Python dependencies | ||
run: uv sync --frozen | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-python-env | ||
|
||
- name: Run checks | ||
run: make check | ||
|
||
tests-and-type-check: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
fail-fast: false | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-python-env | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Run tests | ||
run: uv run python -m pytest tests --cov --cov-config=pyproject.toml --cov-report=xml | ||
|
||
- name: Upload coverage reports to Codecov with GitHub Action on Python 3.11 | ||
uses: codecov/codecov-action@v4 | ||
if: ${{ matrix.python-version == '3.11' }} | ||
|
||
check-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-python-env | ||
|
||
- name: Check if documentation can be built | ||
run: uv run mkdocs build -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: release-main | ||
|
||
on: | ||
release: | ||
types: [published] | ||
branches: [main] | ||
|
||
jobs: | ||
set-version: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Export tag | ||
id: vars | ||
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT | ||
if: ${{ github.event_name == 'release' }} | ||
|
||
- name: Update project version | ||
run: | | ||
sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml | ||
env: | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
if: ${{ github.event_name == 'release' }} | ||
|
||
- name: Upload updated pyproject.toml | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pyproject-toml | ||
path: pyproject.toml | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [set-version] | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-python-env | ||
|
||
- name: Download updated pyproject.toml | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: pyproject-toml | ||
|
||
- name: Build package | ||
run: uvx --from build pyproject-build --installer uv | ||
|
||
- name: Publish package | ||
run: uvx twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
|
||
deploy-docs: | ||
needs: publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/actions/setup-python-env | ||
|
||
- name: Deploy documentation | ||
run: uv run mkdocs gh-deploy --force |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.