Skip to content

Commit 9d01b04

Browse files
committed
Initial commit
Using our `python-template` repo with cookiecutter.
0 parents  commit 9d01b04

20 files changed

Lines changed: 570 additions & 0 deletions

.codespell_ignore.txt

Whitespace-only changes.

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
indent_style = space
8+
indent_size = 4
9+
max_line_length = 88
10+
11+
[*.md]
12+
indent_size = 2
13+
14+
[*.yaml]
15+
indent_size = 2
16+
17+
[*.yml]
18+
indent_size = 2
19+
20+
[Makefile]
21+
indent_style = tab

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Description
2+
3+
_Please include a summary of the change and which issue is fixed (if any). Please also
4+
include relevant motivation and context. List any dependencies that are required for
5+
this change._
6+
7+
Close # (issue)
8+
9+
## Type of change
10+
11+
- [ ] Documentation (non-breaking change that adds or improves the documentation)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Optimization (non-breaking, back-end change that speeds up the code)
14+
- [ ] Bug fix (non-breaking change which fixes an issue)
15+
- [ ] Breaking change (whatever its nature)
16+
17+
## Key checklist
18+
19+
- [ ] All tests pass (eg. `python -m pytest`)
20+
- [ ] Pre-commit hooks run successfully (eg. `pre-commit run --all-files`)
21+
22+
## Further checks
23+
24+
- [ ] Code is commented, particularly in hard-to-understand areas
25+
- [ ] Tests added or an issue has been opened to tackle that in the future.
26+
(Indicate issue here: # (issue))

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: uv
9+
directory: /
10+
schedule:
11+
interval: weekly
12+
- package-ecosystem: github-actions
13+
directory: /
14+
schedule:
15+
interval: weekly

.github/workflows/auto-merge.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dependabot and Pre-commit auto-merge
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write # Needed if in a private repository
9+
10+
jobs:
11+
auto-merge:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
14+
steps:
15+
- name: Enable auto-merge for Dependabot PRs
16+
run: |
17+
gh pr review --approve "$PR_URL"
18+
gh pr merge --auto --merge "$PR_URL"
19+
env:
20+
PR_URL: ${{ github.event.pull_request.html_url }}
21+
# GitHub provides this variable in the CI env. You don't
22+
# need to add anything to the secrets vault.
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/check-links.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Check links in Markdown files
2+
on:
3+
schedule:
4+
- cron: 0 0 * * 1 # midnight every Monday
5+
push:
6+
branches: [main]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
check-links:
12+
name: Linkspector
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Run linkspector
17+
uses: umbrelladocs/action-linkspector@v1
18+
with:
19+
github_token: ${{ secrets.github_token }}
20+
reporter: github-pr-review

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test and build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
workflow_call:
9+
10+
jobs:
11+
test:
12+
runs-on: ${{matrix.os}}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
- windows-latest
19+
- macos-latest
20+
python-version: ['3.13']
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: astral-sh/setup-uv@v7
25+
with:
26+
enable-cache: true
27+
prune-cache: false
28+
activate-environment: true
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies
32+
run: uv sync
33+
34+
- name: Run mypy
35+
run: mypy .
36+
37+
- name: Run tests
38+
run: pytest

.gitignore

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/

.markdownlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Disable checks here
2+
MD013: false
3+
MD007:
4+
indent: 4

.pre-commit-config.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: debug-statements
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: pretty-format-json
10+
args: [--autofix, --indent, '4', --no-sort]
11+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
12+
rev: v2.14.0
13+
hooks:
14+
- id: pretty-format-yaml
15+
args: [--autofix, --indent, '2', --offset, '2']
16+
- repo: https://github.com/python-jsonschema/check-jsonschema
17+
rev: 0.33.1
18+
hooks:
19+
- id: check-dependabot
20+
- id: check-github-actions
21+
- id: check-github-workflows
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.12.0
24+
hooks:
25+
- id: ruff-check
26+
args: [--fix, --exit-non-zero-on-fix]
27+
- id: ruff-format
28+
- repo: https://github.com/pre-commit/mirrors-mypy
29+
rev: v1.16.1
30+
hooks:
31+
- id: mypy
32+
- repo: https://github.com/igorshubovych/markdownlint-cli
33+
rev: v0.45.0
34+
hooks:
35+
- id: markdownlint-fix
36+
- repo: https://github.com/codespell-project/codespell
37+
rev: v2.4.1
38+
hooks:
39+
- id: codespell
40+
args: [-I, .codespell_ignore.txt]
41+
- repo: https://github.com/ComPWA/taplo-pre-commit
42+
rev: v0.9.3
43+
hooks:
44+
- id: taplo-format # Format TOML files
45+
- id: taplo-lint

0 commit comments

Comments
 (0)