Skip to content

Commit 1f5bbcf

Browse files
committed
Initial Release
0 parents  commit 1f5bbcf

170 files changed

Lines changed: 14051 additions & 0 deletions

File tree

Some content is hidden

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

‎.github/workflows/tests.yml‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install Poetry
25+
uses: snok/install-poetry@v1
26+
with:
27+
version: 1.8.3
28+
virtualenvs-create: true
29+
virtualenvs-in-project: true
30+
31+
- name: Load cached venv
32+
id: cached-poetry-dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: .venv
36+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
37+
38+
- name: Install dependencies
39+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
40+
run: poetry install --no-interaction --no-root
41+
42+
- name: Install project
43+
run: poetry install --no-interaction
44+
45+
- name: Run tests with coverage
46+
run: |
47+
poetry run pytest --cov=postmark --cov-report=xml --cov-report=term --cov-fail-under=85
48+
49+
lint:
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up Python
56+
uses: actions/setup-python@v4
57+
with:
58+
python-version: "3.11"
59+
60+
- name: Install Poetry
61+
uses: snok/install-poetry@v1
62+
with:
63+
version: 1.8.3
64+
virtualenvs-create: true
65+
virtualenvs-in-project: true
66+
67+
- name: Install dependencies
68+
run: |
69+
poetry install --no-interaction --with dev
70+
71+
- name: Run Ruff lint
72+
run: poetry run ruff check .
73+
74+
- name: Run Ruff format
75+
run: poetry run ruff format --check .
76+
77+
- name: Run MyPy
78+
run: poetry run mypy postmark/

‎.gitignore‎

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[codz]
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+
#poetry.toml
110+
111+
# pdm
112+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115+
#pdm.lock
116+
#pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# pixi
121+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122+
#pixi.lock
123+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124+
# in the .venv directory. It is recommended not to include this directory in version control.
125+
.pixi
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+
.envrc
140+
.venv
141+
env/
142+
venv/
143+
ENV/
144+
env.bak/
145+
venv.bak/
146+
147+
# Spyder project settings
148+
.spyderproject
149+
.spyproject
150+
151+
# Rope project settings
152+
.ropeproject
153+
154+
# mkdocs documentation
155+
/site
156+
157+
# mypy
158+
.mypy_cache/
159+
.dmypy.json
160+
dmypy.json
161+
162+
# Pyre type checker
163+
.pyre/
164+
165+
# pytype static type analyzer
166+
.pytype/
167+
168+
# Cython debug symbols
169+
cython_debug/
170+
171+
# PyCharm
172+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174+
# and can be added to the global gitignore or merged into this file. For a more nuclear
175+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
176+
#.idea/
177+
178+
# Abstra
179+
# Abstra is an AI-powered process automation framework.
180+
# Ignore directories containing user credentials, local state, and settings.
181+
# Learn more at https://abstra.io/docs
182+
.abstra/
183+
184+
# Visual Studio Code
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188+
# you could uncomment the following to ignore the entire vscode folder
189+
# .vscode/
190+
191+
# Ruff stuff:
192+
.ruff_cache/
193+
194+
# PyPI configuration file
195+
.pypirc
196+
197+
# Cursor
198+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200+
# refer to https://docs.cursor.com/context/ignore-files
201+
.cursorignore
202+
.cursorindexingignore
203+
204+
# Marimo
205+
marimo/_static/
206+
marimo/_lsp/
207+
__marimo__/
208+
.DS_Store
209+
poetry.lock

‎.pre-commit-config.yaml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-json
9+
exclude: '^\.vscode/'
10+
- id: check-toml
11+
- id: check-added-large-files
12+
- id: debug-statements
13+
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.9.10
16+
hooks:
17+
- id: ruff
18+
args: [--fix]
19+
- id: ruff-format
20+
21+
- repo: https://github.com/pre-commit/mirrors-mypy
22+
rev: v1.14.1
23+
hooks:
24+
- id: mypy
25+
args: [--ignore-missing-imports]
26+
additional_dependencies:
27+
- pydantic
28+
- httpx
29+
30+
- repo: https://github.com/codespell-project/codespell
31+
rev: v2.3.0
32+
hooks:
33+
- id: codespell
34+
args: [--skip, "*.lock,*.json"]
35+
36+
- repo: https://github.com/PyCQA/bandit
37+
rev: 1.8.3
38+
hooks:
39+
- id: bandit
40+
args: [-c, pyproject.toml]
41+
additional_dependencies: ["bandit[toml]"]

‎.vscode/settings.json‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
// Python settings
3+
"python.testing.pytestEnabled": true,
4+
"python.testing.unittestEnabled": false,
5+
"python.testing.pytestArgs": [
6+
"tests"
7+
],
8+
// Ruff handles formatting and linting
9+
"[python]": {
10+
"editor.formatOnSave": true,
11+
"editor.defaultFormatter": "charliermarsh.ruff",
12+
"editor.codeActionsOnSave": {
13+
"source.fixAll.ruff": "explicit",
14+
"source.organizeImports.ruff": "explicit"
15+
}
16+
},
17+
// File associations
18+
"files.associations": {
19+
"*.md": "markdown",
20+
"*.yml": "yaml",
21+
"*.toml": "toml"
22+
},
23+
// Exclude from search/watch
24+
"files.exclude": {
25+
"**/__pycache__": true,
26+
"**/*.pyc": true,
27+
".pytest_cache": true,
28+
"*.egg-info": true,
29+
".coverage": true,
30+
"htmlcov": true,
31+
"dist": true,
32+
"build": true
33+
},
34+
// Type checking
35+
"python.analysis.typeCheckingMode": "basic"
36+
}

0 commit comments

Comments
 (0)