Skip to content

Commit 6a83114

Browse files
zoola969Copilot
andauthored
Init logic (#4)
init logic Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b06e574 commit 6a83114

47 files changed

Lines changed: 3898 additions & 4 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: uv
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
open-pull-requests-limit: 10
13+
assignees:
14+
- "zoola969"
15+
reviewers:
16+
- "zoola969"
17+
commit-message:
18+
prefix: "deps"
19+
include: "scope"

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# TODO: add an url once the package name is registered on PyPI
2+
name: Publish to PyPI
3+
4+
on:
5+
release:
6+
types:
7+
- created
8+
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: "Set up Python"
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version-file: ".python-version"
19+
20+
- name: Install project
21+
run: uv sync --locked --no-default-groups
22+
23+
- name: Build
24+
run: uv build
25+
26+
- name: Store package distributions
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: Publish
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: pypi
39+
url: "placeholder"
40+
41+
permissions:
42+
id-token: write # IMPORTANT: mandatory for trusted publishing
43+
44+
steps:
45+
- name: Download all the dists
46+
uses: actions/download-artifact@v3
47+
with:
48+
name: python-package-distributions
49+
path: dist/
50+
- name: Publish distribution to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Tests
3+
4+
on:
5+
push:
6+
branches: ["master"]
7+
pull_request:
8+
branches: ["master"]
9+
10+
jobs:
11+
tests:
12+
name: "Python ${{ matrix.python-version }}"
13+
runs-on: "ubuntu-latest"
14+
15+
strategy:
16+
matrix:
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install uv and set the python version
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: "Install dependencies"
27+
run: uv sync --locked --no-default-groups --no-install-project --group dev --group test
28+
29+
- name: "Run mypy"
30+
run: uv run --no-project mypy py_cashier
31+
32+
- name: "Run tests"
33+
run: uv run --no-project coverage run -m pytest tests/
34+
35+
- name: "Enforce coverage"
36+
run: uv run --no-project coverage report --show-missing --skip-covered --fail-under=100

.gitignore

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

.pre-commit-config.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
ci:
2-
autoupdate_schedule: monthly
2+
autoupdate_schedule: weekly
3+
autofix_prs: false
4+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
5+
default_language_version:
6+
python: python3.9
37
repos:
48
- repo: https://github.com/pre-commit/pre-commit-hooks
59
rev: v5.0.0
@@ -13,8 +17,8 @@ repos:
1317
- id: debug-statements
1418
- id: end-of-file-fixer
1519
- id: trailing-whitespace
16-
# - id: no-commit-to-branch
17-
# args: [ --branch, master ]
20+
- id: no-commit-to-branch
21+
args: [ --branch, master ]
1822
- repo: https://github.com/pycqa/isort
1923
rev: 6.0.1
2024
hooks:
@@ -24,7 +28,7 @@ repos:
2428
hooks:
2529
- id: add-trailing-comma
2630
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: 'v0.12.2'
31+
rev: 'v0.12.3'
2832
hooks:
2933
- id: ruff
3034
args: [ --fix, --exit-non-zero-on-fix ]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.9

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

0 commit comments

Comments
 (0)