Skip to content

Commit 0305009

Browse files
committed
Initial commit
0 parents  commit 0305009

File tree

14 files changed

+1889
-0
lines changed

14 files changed

+1889
-0
lines changed

.github/workflows/publish.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.11'
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v3
24+
25+
- name: Build package
26+
run: uv build
27+
28+
- name: Upload build artifacts
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: dist
32+
path: dist/
33+
34+
test-pypi:
35+
runs-on: ubuntu-latest
36+
needs: build
37+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Download build artifacts
43+
uses: actions/download-artifact@v3
44+
with:
45+
name: dist
46+
path: dist/
47+
48+
- name: Publish to Test PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
52+
repository-url: https://test.pypi.org/legacy/
53+
54+
pypi:
55+
runs-on: ubuntu-latest
56+
needs: [build, test-pypi]
57+
if: github.event_name == 'release'
58+
environment: release
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Download build artifacts
64+
uses: actions/download-artifact@v3
65+
with:
66+
name: dist
67+
path: dist/
68+
69+
- name: Publish to PyPI
70+
uses: pypa/gh-action-pypi-publish@release/v1
71+
with:
72+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/quality.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v3
23+
24+
- name: Install dependencies
25+
run: |
26+
uv sync --dev
27+
uv add --dev black isort flake8 mypy
28+
29+
- name: Check code formatting with Black
30+
run: uv run black --check --diff src/ tests/
31+
32+
- name: Check import sorting with isort
33+
run: uv run isort --check --diff src/ tests/
34+
35+
- name: Run flake8
36+
run: uv run flake8 src/ tests/ --max-line-length=88 --extend-ignore=E203,W503
37+
38+
- name: Run mypy
39+
run: uv run mypy src/ --ignore-missing-imports

.github/workflows/test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v3
27+
with:
28+
enable-cache: true
29+
30+
- name: Install dependencies
31+
run: uv sync --dev
32+
33+
- name: Run tests
34+
run: uv run pytest tests/ -v --tb=short
35+
36+
- name: Run type checking
37+
run: uv run python -m py_compile src/explicit_implementation/*.py
38+
39+
coverage:
40+
runs-on: ubuntu-latest
41+
needs: test
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: '3.11'
50+
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v3
53+
54+
- name: Install dependencies
55+
run: |
56+
uv sync --dev
57+
uv add --dev pytest-cov
58+
59+
- name: Run tests with coverage
60+
run: uv run pytest tests/ --cov=src/explicit_implementation --cov-report=xml --cov-report=html
61+
62+
- name: Upload coverage to Codecov
63+
uses: codecov/codecov-action@v3
64+
with:
65+
file: ./coverage.xml
66+
fail_ci_if_error: true

.gitignore

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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/
130+
131+
# IDEs
132+
.vscode/
133+
.idea/
134+
*.swp
135+
*.swo
136+
*~
137+
138+
# OS
139+
.DS_Store
140+
Thumbs.db

0 commit comments

Comments
 (0)