Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .cursor/rules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
python-development.mdc
python-general.mdc
python-github-actions.mdc
python-markdown-documentation.mdc
python-packaging-modernization.mdc
python-testing.mdc
python-version-control.mdc
python-version-management.mdc
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* @shakefu

# Ignore certain files so they can be auto-updated
.pre-commit-config.yaml
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: shakefu
2 changes: 2 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
self-hosted-runner:
labels: []
127 changes: 127 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
name: CI

on:
# Allow this config to be reused by other workflows in the repo
workflow_call:
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.event.number || 'main' }}
cancel-in-progress: true

jobs:
preview:
name: Release preview
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Generate notes
id: notes
uses: open-turo/actions-release/semantic-release@4d8a6b6aa2d051e7dba0429d8d08beef827b5ccd # v4
with:
branches: ${{ github.head_ref }}
override-github-ref-name: ${{ github.head_ref }}
dry-run: true
ci: false
- name: Find Comment
uses: peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2
id: find
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: release-notes-preview
- name: Comment preview
uses: peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d # v2
if: steps.notes.outputs.new-release-notes != ''
with:
comment-id: ${{ steps.find.outputs.comment-id }}
issue-number: ${{ github.event.number }}
edit-mode: replace
body: |
<!-- release-notes-preview -->

## Release notes preview

${{ steps.notes.outputs.new-release-notes }}

lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v5
with:
python-version: ${{ matrix.python-version }}
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
with:
version: "0.7.12"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Pytest
uv sync --locked --all-extras --dev
uv run pytest --cov
uv run coveralls

docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v5
with:
python-version-file: ".python-version"
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Build docs
uv run script/docs

checks:
name: Checks
needs: [lint, test, docs]
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Renovate / Auto-approve
if: github.actor == 'renovatebot' || github.actor == 'renovate[bot]'
uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Renovate / Auto-merge
if: github.actor == 'renovatebot' || github.actor == 'renovate[bot]'
uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 # v0.15.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_LABELS: dependencies
MERGE_METHOD: rebase
84 changes: 84 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
name: Release

on:
push:
branches: [main]

concurrency:
group: release

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yaml

release:
name: Release
needs: ci
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.new-release-version }}
published: ${{ steps.version.outputs.new-release-published }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- id: version
uses: open-turo/actions-release/semantic-release@4d8a6b6aa2d051e7dba0429d8d08beef827b5ccd # v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
dry-run: true
ci: false

publish:
name: Publish
needs: release
runs-on: ubuntu-latest
if: needs.release.outputs.published == 'true'
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- id: authenticate
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2
with:
app-id: ${{ secrets.BOT_CLIENT_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
token: ${{ steps.authenticate.outputs.token }}
fetch-depth: 0
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v5
with:
python-version-file: ".python-version"
- uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- run: |
# Install dependencies
uv sync --locked --all-extras --dev
- id: version
uses: open-turo/actions-release/semantic-release@4d8a6b6aa2d051e7dba0429d8d08beef827b5ccd # v4
with:
github-token: ${{ steps.authenticate.outputs.token }}
dry-run: true
ci: false
- run: |
# Update version
uv version ${{ steps.version.outputs.new-release-version }}
- uses: actions-js/push@master
with:
message: "chore: ${{ steps.version.outputs.new-release-version }} [skip actions]"
github_token: ${{ steps.authenticate.outputs.token }}
- run: |
# Build package
uv build
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
- uses: open-turo/actions-release/semantic-release@4d8a6b6aa2d051e7dba0429d8d08beef827b5ccd # v4
with:
github-token: ${{ steps.authenticate.outputs.token }}
29 changes: 25 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,34 @@ pip-log.txt

# Unit test / coverage reports
.coverage
.coverage.*
coverage.xml
htmlcov/
.tox
.nox
.cache
.pytest_cache/
.hypothesis/
*.cover
*.py,cover
.coverage_html/
.pytest_cache

#Translations
# Translations
*.mo

#Mr Developer
# Mr Developer
.mr.developer.cfg

# Pyconfig
localconfig.py
# Vim
*.swp

# Sphinx
docs/_build
docs/_output

# Cursor
.cursorrules

# VSCode
.vscode
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.22.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@open-turo/commitlint-config-conventional"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
stages: [pre-commit]
# - repo: https://github.com/rhysd/actionlint
# rev: v1.6.17
# hooks:
# - id: actionlint
# - repo: https://github.com/jumanjihouse/pre-commit-hooks
# rev: 3.0.0 # or specific git tag
# hooks:
# - id: shellcheck
# - id: shfmt
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.18.1
hooks:
- id: markdownlint-cli2
args: ["--fix", ".cursorrules"]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.11.13
hooks:
# Run the Ruff linter.
- id: ruff
# Run the Ruff formatter.
- id: ruff-format
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
42 changes: 42 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"type": [
{ "type": "build", "section": "Build System", "hidden": false },
{ "type": "chore", "section": "Miscellaneous", "hidden": false },
{
"type": "ci",
"section": "Continuous Integration",
"hidden": false
},
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": false
},
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false }
]
},
"writerOpts": {
"commitsSort": ["subject", "scope"]
}
}
],
"@semantic-release/github"
]
}
Loading
Loading