Skip to content

Commit 1004039

Browse files
authored
Initial commit
0 parents  commit 1004039

14 files changed

Lines changed: 716 additions & 0 deletions
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
pull_request:
8+
push:
9+
branches:
10+
- main
11+
tags:
12+
- "v*"
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest] #, windows-latest, macos-latest]
21+
python-version:
22+
- "3.9"
23+
- "3.10"
24+
- "3.11"
25+
- "3.12"
26+
- "3.13"
27+
- "pypy-3.9"
28+
29+
name: ${{ matrix.os }} - ${{ matrix.python-version }}
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Get history and tags for SCM versioning to work
33+
run: |
34+
git fetch --prune --unshallow
35+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v5
38+
with:
39+
version: "0.5.22"
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
- name: Install dependencies
45+
run: pip install tox tox-uv
46+
- name: Run tox
47+
# Run tox using the version of Python in `PATH`
48+
run: tox -e py
49+
50+
dist:
51+
runs-on: ubuntu-latest
52+
needs: [test]
53+
name: Build Python packages
54+
steps:
55+
- uses: actions/checkout@v4
56+
- name: Get history and tags for SCM versioning to work
57+
run: |
58+
git fetch --prune --unshallow
59+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: "3.9"
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
pip install --upgrade wheel setuptools build
67+
- name: Build package
68+
run: python -m build -s -w -o dist/
69+
- uses: actions/upload-artifact@v4
70+
with:
71+
name: dist
72+
path: dist
73+
74+
dist_check:
75+
runs-on: ubuntu-latest
76+
needs: [dist]
77+
name: Twine check
78+
steps:
79+
- uses: actions/setup-python@v5
80+
with:
81+
python-version: "3.9"
82+
- name: Install dependencies
83+
run: pip install twine
84+
- uses: actions/download-artifact@v4
85+
with:
86+
name: dist
87+
path: dist
88+
- run: twine check dist/*
89+
90+
dist_upload:
91+
runs-on: ubuntu-latest
92+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
93+
needs: [dist_check]
94+
name: PyPI upload
95+
permissions:
96+
id-token: write
97+
steps:
98+
- uses: actions/download-artifact@v4
99+
with:
100+
name: dist
101+
path: dist
102+
- name: Publish package to PyPI
103+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
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+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
169+
170+
# PyPI configuration file
171+
.pypirc
172+
173+
# Generated by setuptools_scm
174+
package/_version.py

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: "meta"
3+
hooks:
4+
- id: "check-hooks-apply"
5+
- id: "check-useless-excludes"
6+
7+
- repo: "https://github.com/pre-commit/pre-commit-hooks"
8+
rev: "v5.0.0"
9+
hooks:
10+
- id: "check-added-large-files"
11+
- id: "check-merge-conflict"
12+
- id: "check-yaml"
13+
14+
- repo: "https://github.com/astral-sh/ruff-pre-commit"
15+
rev: "v0.9.2"
16+
hooks:
17+
- id: "ruff"
18+
args: ["--fix"]
19+
20+
- repo: "https://github.com/psf/black-pre-commit-mirror"
21+
rev: "24.10.0"
22+
hooks:
23+
- id: "black"
24+
language_version: "python3.11"

0 commit comments

Comments
 (0)