Skip to content

Commit a3f4661

Browse files
committed
First Commit
0 parents  commit a3f4661

34 files changed

+2865
-0
lines changed

.gitattributes

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

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main, develop]
5+
paths: ["src/**", "tests/**", ".github/workflows/ci.yml"]
6+
pull_request:
7+
branches: [main, develop]
8+
paths: ["src/**", "tests/**", ".github/workflows/ci.yml"]
9+
workflow_dispatch:
10+
11+
jobs:
12+
CI:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Install Rye
23+
run: |
24+
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
25+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
26+
27+
- name: Install external tool dependencies
28+
run: |
29+
sudo apt update -y
30+
sudo apt install -y graphviz libgraphviz-dev
31+
if: ${{ matrix.os=='ubuntu-latest' }}
32+
33+
- name: Setup Python ${{matrix.python-version}} & Dependencies
34+
run: |
35+
rye pin ${{ matrix.python-version }}
36+
rye sync --update-all --all-features
37+
38+
- name: Run ruff lint check
39+
run: rye run ruff check --diff
40+
41+
- name: Run ruff format check
42+
run: rye run ruff format --check --diff
43+
44+
- name: Run pytest
45+
run: rye run pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src | tee pytest-coverage.txt
46+
47+
- name: Pytest Coverage Comment
48+
uses: MishaKav/pytest-coverage-comment@main
49+
with:
50+
pytest-coverage-path: pytest-coverage.txt
51+
junitxml-path: pytest.xml
52+
if: ${{ matrix.os=='ubuntu-latest' && matrix.python-version=='3.12' && !env.ACT }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish MkDocs
2+
3+
on:
4+
release:
5+
types: [released]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish_mkdocs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Install Rye
16+
run: |
17+
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
18+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
19+
20+
- name: Install Python & MkDocs & Plugins
21+
run: rye sync
22+
23+
- name: Publish document
24+
run: rye run mkdocs gh-deploy --force
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types: [released]
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish_to_pypi:
9+
name: Publish to PyPI
10+
runs-on: ubuntu-latest
11+
env:
12+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
13+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install Rye
19+
run: |
20+
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
21+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
22+
23+
- name: Build
24+
run: rye build
25+
26+
- name: Publish
27+
run: rye publish -u $PYPI_USERNAME --token $PYPI_PASSWORD -y

.gitignore

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
examples
2+
.vscode/
3+
notebooks/
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+
pip-wheel-metadata/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.py,cover
55+
.hypothesis/
56+
.pytest_cache/
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+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
.python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: v0.11.8
6+
hooks:
7+
- id: ruff
8+
name: ruff lint check
9+
types_or: [python, pyi]
10+
args: [--fix]
11+
- id: ruff-format
12+
name: ruff format check
13+
types_or: [python, pyi]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 moshi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)