Skip to content

Commit 5c616fa

Browse files
committed
initial
0 parents  commit 5c616fa

35 files changed

+2190
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Setup Python Environment"
2+
description: "Set up Python environment for the given Python version"
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
default: "3.12"
9+
uv-version:
10+
description: "uv version to use"
11+
required: true
12+
default: "0.6.2"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v2
23+
with:
24+
version: ${{ inputs.uv-version }}
25+
enable-cache: 'true'
26+
cache-suffix: ${{ matrix.python-version }}
27+
28+
- name: Install Python dependencies
29+
run: uv sync --frozen
30+
shell: bash

.github/workflows/main.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
jobs:
11+
# quality:
12+
# runs-on: ubuntu-latest
13+
# steps:
14+
# - name: Check out
15+
# uses: actions/checkout@v4
16+
17+
# - uses: actions/cache@v4
18+
# with:
19+
# path: ~/.cache/pre-commit
20+
# key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
21+
22+
# - name: Set up the environment
23+
# uses: ./.github/actions/setup-python-env
24+
25+
# - name: Run checks
26+
# run: make check
27+
28+
tests-and-type-check:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
33+
fail-fast: false
34+
defaults:
35+
run:
36+
shell: bash
37+
steps:
38+
- name: Check out
39+
uses: actions/checkout@v4
40+
41+
- name: Set up the environment
42+
uses: ./.github/actions/setup-python-env
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
46+
- name: Run tests
47+
run: uv run python -m pytest tests --cov --cov-config=pyproject.toml --cov-report=xml
48+
49+
# - name: Check typing
50+
# run: uv run mypy
51+
52+
53+
- name: Upload coverage reports to Codecov with GitHub Action on Python 3.11
54+
uses: codecov/codecov-action@v4
55+
if: ${{ matrix.python-version == '3.11' }}

.github/workflows/on-release-main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: release-main
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
set-version:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Export tag
15+
id: vars
16+
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
17+
if: ${{ github.event_name == 'release' }}
18+
19+
- name: Update project version
20+
run: |
21+
sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml
22+
env:
23+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
24+
if: ${{ github.event_name == 'release' }}
25+
26+
- name: Upload updated pyproject.toml
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: pyproject-toml
30+
path: pyproject.toml
31+
32+
publish:
33+
runs-on: ubuntu-latest
34+
needs: [set-version]
35+
steps:
36+
- name: Check out
37+
uses: actions/checkout@v4
38+
39+
- name: Set up the environment
40+
uses: ./.github/actions/setup-python-env
41+
42+
- name: Download updated pyproject.toml
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: pyproject-toml
46+
47+
- name: Build package
48+
run: uv build
49+
50+
- name: Publish package
51+
run: uv publish
52+
env:
53+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
54+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: validate-codecov-config
2+
3+
on:
4+
pull_request:
5+
paths: [codecov.yaml]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
validate-codecov-config:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Validate codecov configuration
15+
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate

.gitignore

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
docs/source
2+
3+
# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
.pybuilder/
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
90+
__pypackages__/
91+
92+
# Celery stuff
93+
celerybeat-schedule
94+
celerybeat.pid
95+
96+
# SageMath parsed files
97+
*.sage.py
98+
99+
# Environments
100+
.env
101+
.venv
102+
env/
103+
venv/
104+
ENV/
105+
env.bak/
106+
venv.bak/
107+
108+
# Spyder project settings
109+
.spyderproject
110+
.spyproject
111+
112+
# Rope project settings
113+
.ropeproject
114+
115+
# mkdocs documentation
116+
/site
117+
118+
# mypy
119+
.mypy_cache/
120+
.dmypy.json
121+
dmypy.json
122+
123+
# Pyre type checker
124+
.pyre/
125+
126+
# pytype static type analyzer
127+
.pytype/
128+
129+
# Cython debug symbols
130+
cython_debug/
131+
132+
# Vscode config files
133+
.vscode/
134+
135+
# PyCharm
136+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
137+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
138+
# and can be added to the global gitignore or merged into this file. For a more nuclear
139+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
140+
#.idea/
141+
142+
# Database files
143+
*.db
144+
*.sqlite

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: "v5.0.0"
4+
hooks:
5+
- id: check-case-conflict
6+
- id: check-merge-conflict
7+
- id: check-toml
8+
- id: check-yaml
9+
- id: check-json
10+
exclude: ^.devcontainer/devcontainer.json
11+
- id: pretty-format-json
12+
exclude: ^.devcontainer/devcontainer.json
13+
args: [--autofix]
14+
- id: end-of-file-fixer
15+
- id: trailing-whitespace
16+
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: "v0.6.3"
19+
hooks:
20+
- id: ruff
21+
args: [--exit-non-zero-on-fix]
22+
- id: ruff-format

0 commit comments

Comments
 (0)