Skip to content

Commit 3501954

Browse files
committed
Code refactoring and PyPI integratio
1 parent 7db61dd commit 3501954

File tree

15 files changed

+375653
-353
lines changed

15 files changed

+375653
-353
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
ignore = E203, E501
3+
max-line-length = 88

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Run Python Tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
10+
jobs:
11+
test:
12+
name: Test on Python ${{ matrix.python-version }} on ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
python-version: ["3.8", "3.9", "3.10", "3.11"]
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install pytest
34+
pip install -e .
35+
36+
- name: Run tests
37+
run: |
38+
pytest

.gitignore

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
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+
.idea/
12+
build/
13+
etest/
14+
log/
15+
Temp/
16+
Temp_Chrome/
17+
re3s.py
18+
*.html
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
share/python-wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
MANIFEST
35+
36+
# PyInstaller
37+
# Usually these files are written by a python script from a template
38+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
39+
*.manifest
40+
*.spec
41+
42+
# Installer logs
43+
pip-log.txt
44+
pip-delete-this-directory.txt
45+
46+
# Unit test / coverage reports
47+
htmlcov/
48+
.tox/
49+
.nox/
50+
.coverage
51+
.coverage.*
52+
.cache
53+
nosetests.xml
54+
coverage.xml
55+
*.cover
56+
*.py,cover
57+
.hypothesis/
58+
.pytest_cache/
59+
cover/
60+
61+
# Translations
62+
*.mo
63+
*.pot
64+
65+
# Django stuff:
66+
*.log
67+
local_settings.py
68+
db.sqlite3
69+
db.sqlite3-journal
70+
71+
# Flask stuff:
72+
instance/
73+
.webassets-cache
74+
75+
# Scrapy stuff:
76+
.scrapy
77+
78+
# Sphinx documentation
79+
docs/_build/
80+
81+
# PyBuilder
82+
.pybuilder/
83+
target/
84+
85+
# Jupyter Notebook
86+
.ipynb_checkpoints
87+
88+
# IPython
89+
profile_default/
90+
ipython_config.py
91+
92+
# pyenv
93+
# For a library or package, you might want to ignore these files since the code is
94+
# intended to run in multiple environments; otherwise, check them in:
95+
# .python-version
96+
97+
# pipenv
98+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
99+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
100+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
101+
# install all needed dependencies.
102+
#Pipfile.lock
103+
104+
# UV
105+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
106+
# This is especially recommended for binary packages to ensure reproducibility, and is more
107+
# commonly ignored for libraries.
108+
#uv.lock
109+
110+
# poetry
111+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
112+
# This is especially recommended for binary packages to ensure reproducibility, and is more
113+
# commonly ignored for libraries.
114+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
115+
#poetry.lock
116+
117+
# pdm
118+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
119+
#pdm.lock
120+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
121+
# in version control.
122+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
123+
.pdm.toml
124+
.pdm-python
125+
.pdm-build/
126+
127+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128+
__pypackages__/
129+
130+
# Celery stuff
131+
celerybeat-schedule
132+
celerybeat.pid
133+
134+
# SageMath parsed files
135+
*.sage.py
136+
137+
# Environments
138+
.env
139+
.venv
140+
env/
141+
venv/
142+
ENV/
143+
env.bak/
144+
venv.bak/
145+
146+
# Spyder project settings
147+
.spyderproject
148+
.spyproject
149+
150+
# Rope project settings
151+
.ropeproject
152+
153+
# mkdocs documentation
154+
/site
155+
156+
# mypy
157+
.mypy_cache/
158+
.dmypy.json
159+
dmypy.json
160+
161+
# Pyre type checker
162+
.pyre/
163+
164+
# pytype static type analyzer
165+
.pytype/
166+
167+
# Cython debug symbols
168+
cython_debug/
169+
170+
# PyCharm
171+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
172+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
173+
# and can be added to the global gitignore or merged into this file. For a more nuclear
174+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
175+
#.idea/
176+
177+
# PyPI configuration file
178+
.pypirc
179+
etest_morre.py

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 25.1.0
4+
hooks:
5+
- id: black
6+
7+
- repo: https://github.com/PyCQA/isort
8+
rev: 6.0.1
9+
hooks:
10+
- id: isort
11+
12+
- repo: https://github.com/PyCQA/flake8
13+
rev: 7.3.0
14+
hooks:
15+
- id: flake8
16+
17+
- repo: https://github.com/PyCQA/bandit
18+
rev: 1.8.6
19+
hooks:
20+
- id: bandit
21+
args: ["-r", "card_generator", "-x", "tests"]
22+
pass_filenames: false
23+
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v5.0.0
26+
hooks:
27+
- id: end-of-file-fixer
28+
- id: trailing-whitespace
29+
- id: check-yaml

0 commit comments

Comments
 (0)