Skip to content

Commit 9bf872b

Browse files
committed
Initialize repository
0 parents  commit 9bf872b

23 files changed

+4981
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.ipynb linguist-vendored

.github/workflows/ci.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.head_ref }}
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.11'
21+
- run: pip install ruff
22+
- name: Run Ruff to auto-fix code
23+
run: ruff format . --exclude '*.ipynb'
24+
- name: Commit formatted code
25+
uses: stefanzweifel/git-auto-commit-action@v5
26+
with:
27+
commit_message: "style: autoformat code with ruff"
28+
29+
precommit:
30+
needs:
31+
- format
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: actions/setup-python@v3
36+
- uses: pre-commit/action@v3.0.0
37+
38+
lints:
39+
runs-on: ubuntu-latest
40+
needs:
41+
- precommit
42+
strategy:
43+
matrix:
44+
python-version: [ 3.11, 3.12 ]
45+
steps:
46+
- uses: actions/checkout@v3
47+
- name: Set up Python ${{ matrix.python-version }}
48+
uses: actions/setup-python@v3
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
- uses: astral-sh/setup-uv@v5
52+
with:
53+
version: "latest"
54+
- name: Install dependencies
55+
run: |
56+
uv sync --dev
57+
- name: Run lints
58+
run: |
59+
make lints
60+
61+
tests:
62+
runs-on: ubuntu-latest
63+
needs:
64+
- lints
65+
strategy:
66+
matrix:
67+
python-version: [ 3.11, 3.12 ]
68+
steps:
69+
- uses: actions/checkout@v3
70+
- name: Set up Python ${{ matrix.python-version }}
71+
uses: actions/setup-python@v3
72+
with:
73+
python-version: ${{ matrix.python-version }}
74+
- uses: astral-sh/setup-uv@v5
75+
with:
76+
version: "latest"
77+
- name: Install dependencies
78+
run: |
79+
uv sync --dev
80+
- name: Run tests
81+
run: |
82+
make tests
83+
- name: Upload coverage reports to Codecov
84+
uses: codecov/codecov-action@v3
85+
env:
86+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/release.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: [3.9]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install pypa/build
21+
run: |
22+
python -m pip install --upgrade build twine
23+
- name: Build a binary wheel and a source tarball
24+
run: |
25+
python -m build --sdist --wheel --outdir dist/ .
26+
- name: Publish a Python distribution to PyPI
27+
if: startsWith(github.ref, 'refs/tags')
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
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+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
105+
__pypackages__/
106+
107+
# Celery stuff
108+
celerybeat-schedule
109+
celerybeat.pid
110+
111+
# SageMath parsed files
112+
*.sage.py
113+
114+
# Environments
115+
.env
116+
.venv
117+
env/
118+
venv/
119+
ENV/
120+
env.bak/
121+
venv.bak/
122+
123+
# Spyder project settings
124+
.spyderproject
125+
.spyproject
126+
127+
# Rope project settings
128+
.ropeproject
129+
130+
# mkdocs documentation
131+
/site
132+
133+
# mypy
134+
.mypy_cache/
135+
.dmypy.json
136+
dmypy.json
137+
138+
# Pyre type checker
139+
.pyre/
140+
141+
# pytype static type analyzer
142+
.pytype/
143+
144+
# Cython debug symbols
145+
cython_debug/
146+
147+
# PyCharm
148+
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
149+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
150+
# and can be added to the global gitignore or merged into this file. For a more nuclear
151+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
152+
.idea/
153+
154+
# vscode
155+
.vscode/
156+
157+
.DS_Store

.gitlint

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[general]
2+
ignore=body-is-missing
3+
4+
[title-min-length]
5+
min-length=10
6+
7+
[title-must-not-contain-word]
8+
words=wip,todo

.pre-commit-config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: check-docstring-first
6+
- id: check-added-large-files
7+
args: ['--maxkb=1000']
8+
- id: check-merge-conflict
9+
- id: check-toml
10+
- id: check-yaml
11+
- id: debug-statements
12+
- id: end-of-file-fixer
13+
- id: no-commit-to-branch
14+
args: [--branch, main]
15+
- id: requirements-txt-fixer
16+
- id: trailing-whitespace
17+
18+
- repo: https://github.com/pre-commit/mirrors-mypy
19+
rev: v1.15.0
20+
hooks:
21+
- id: mypy
22+
args: ["--ignore-missing-imports"]
23+
files: "(fll)"
24+
25+
- repo: https://github.com/astral-sh/ruff-pre-commit
26+
rev: v0.3.0
27+
hooks:
28+
- id: ruff
29+
args: [ --fix ]
30+
- id: ruff-format
31+
32+
- repo: https://github.com/jorisroovers/gitlint
33+
rev: v0.18.0
34+
hooks:
35+
- id: gitlint
36+
- id: gitlint-ci

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11.9

0 commit comments

Comments
 (0)