Skip to content

Commit d1fb016

Browse files
committed
Claude...
1 parent e302c55 commit d1fb016

29 files changed

+2593
-79
lines changed

.coveragerc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[run]
2+
source = src
3+
omit =
4+
*/tests/*
5+
*/test_*.py
6+
*/__pycache__/*
7+
*/migrations/*
8+
*/.venv/*
9+
*/venv/*
10+
*/env/*
11+
*/setup.py
12+
*/conf/*
13+
*/docs/*
14+
15+
[report]
16+
precision = 2
17+
show_missing = True
18+
skip_covered = False
19+
exclude_lines =
20+
pragma: no cover
21+
def __repr__
22+
if self.debug:
23+
if settings.DEBUG
24+
raise AssertionError
25+
raise NotImplementedError
26+
if 0:
27+
if False:
28+
if __name__ == .__main__.:
29+
if TYPE_CHECKING:
30+
class .*\bProtocol\):
31+
@(abc\.)?abstractmethod
32+
33+
[html]
34+
directory = coverage/htmlcov
35+
36+
[xml]
37+
output = coverage/coverage.xml
38+
39+
[json]
40+
output = coverage/coverage.json

.github/workflows/ci.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop ]
6+
pull_request:
7+
branches: [ main, master, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Test Python ${{ matrix.python-version }}
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Cache pip packages
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r requirements.txt
38+
pip install -e .
39+
40+
- name: Run linting
41+
run: |
42+
flake8 src/ tests/ --max-line-length=100 --extend-ignore=E203,W503
43+
black --check src/ tests/ --line-length=100
44+
isort --check-only src/ tests/ --profile black --line-length 100
45+
46+
- name: Run type checking
47+
run: |
48+
mypy src/ --ignore-missing-imports
49+
50+
- name: Run tests with coverage
51+
run: |
52+
pytest tests/ --cov=src --cov-report=xml --cov-report=term-missing
53+
54+
- name: Upload coverage to Codecov
55+
uses: codecov/codecov-action@v3
56+
with:
57+
file: ./coverage.xml
58+
flags: unittests
59+
name: codecov-umbrella
60+
fail_ci_if_error: false
61+
62+
security:
63+
name: Security Check
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Run Bandit Security Check
70+
uses: gaurav-nelson/bandit-action@v1
71+
with:
72+
path: "src/"
73+
74+
- name: Run Safety Check
75+
run: |
76+
pip install safety
77+
safety check --json
78+
79+
build:
80+
name: Build Distribution
81+
runs-on: ubuntu-latest
82+
needs: [test]
83+
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Set up Python
88+
uses: actions/setup-python@v5
89+
with:
90+
python-version: '3.11'
91+
92+
- name: Install build dependencies
93+
run: |
94+
python -m pip install --upgrade pip
95+
pip install build
96+
97+
- name: Build package
98+
run: python -m build
99+
100+
- name: Upload artifacts
101+
uses: actions/upload-artifact@v3
102+
with:
103+
name: dist
104+
path: dist/

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Create GitHub Release
34+
uses: softprops/action-gh-release@v1
35+
with:
36+
files: dist/*
37+
generate_release_notes: true
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Publish to Test PyPI
42+
env:
43+
TWINE_USERNAME: __token__
44+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
45+
run: |
46+
twine upload --repository testpypi dist/* --skip-existing
47+
continue-on-error: true
48+
49+
- name: Publish to PyPI
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
env:
52+
TWINE_USERNAME: __token__
53+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
54+
run: |
55+
twine upload dist/* --skip-existing
56+
continue-on-error: true

.gitignore

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +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+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
coverage/
39+
htmlcov/
40+
.tox/
41+
.nox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
*.py,cover
49+
.hypothesis/
50+
.pytest_cache/
51+
cover/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
db.sqlite3-journal
62+
63+
# Flask stuff:
64+
instance/
65+
.webassets-cache
66+
67+
# Scrapy stuff:
68+
.scrapy
69+
70+
# Sphinx documentation
71+
docs/_build/
72+
73+
# PyBuilder
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+
Pipfile.lock
89+
90+
# poetry
91+
poetry.lock
92+
93+
# pdm
94+
.pdm.toml
95+
96+
# PEP 582
97+
__pypackages__/
98+
99+
# Celery stuff
100+
celerybeat-schedule
101+
celerybeat.pid
102+
103+
# SageMath parsed files
104+
*.sage.py
105+
106+
# Environments
107+
.env
1108
.venv
109+
env/
110+
venv/
111+
ENV/
112+
env.bak/
113+
venv.bak/
114+
115+
# Spyder project settings
116+
.spyderproject
117+
.spyproject
118+
119+
# Rope project settings
120+
.ropeproject
121+
122+
# mkdocs documentation
123+
/site
124+
125+
# mypy
126+
.mypy_cache/
127+
.dmypy.json
128+
dmypy.json
129+
130+
# Pyre type checker
131+
.pyre/
132+
133+
# pytype static type analyzer
134+
.pytype/
135+
136+
# Cython debug symbols
137+
cython_debug/
138+
139+
# PyCharm
140+
.idea/
141+
142+
# VS Code
143+
.vscode/
144+
145+
# macOS
146+
.DS_Store
147+
148+
# Windows
149+
Thumbs.db
150+
ehthumbs.db
151+
152+
# Database files (keep for development, remove for production)
153+
*.db
154+
*.sqlite
155+
*.sqlite3
156+
157+
# Log files
158+
logs/
159+
160+
# Temporary files
161+
*.tmp
162+
*.bak
163+
*.swp
164+
*~
165+
166+
# Coverage reports (now handled by coverage/ directory above)
167+
# coverage.json
168+
# .coverage.*
169+
170+
# Pre-commit
171+
.pre-commit-config.yaml.lock
172+
173+
# Ruff
174+
.ruff_cache/

.idea/Python.Publisher.Subscriber.iml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)