amsdal_mail 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amsdal_mail-0.1.0/.github/workflows/ci.yml +62 -0
- amsdal_mail-0.1.0/.github/workflows/release.yml +107 -0
- amsdal_mail-0.1.0/.github/workflows/tag_check.yml +28 -0
- amsdal_mail-0.1.0/.gitignore +40 -0
- amsdal_mail-0.1.0/CHANGELOG.md +27 -0
- amsdal_mail-0.1.0/PKG-INFO +799 -0
- amsdal_mail-0.1.0/README.md +770 -0
- amsdal_mail-0.1.0/amsdal_mail/Third-Party Materials - AMSDAL Dependencies - License Notices.md +29 -0
- amsdal_mail-0.1.0/amsdal_mail/__about__.py +1 -0
- amsdal_mail-0.1.0/amsdal_mail/__init__.py +164 -0
- amsdal_mail-0.1.0/amsdal_mail/app.py +36 -0
- amsdal_mail-0.1.0/amsdal_mail/backends/__init__.py +103 -0
- amsdal_mail-0.1.0/amsdal_mail/backends/base.py +87 -0
- amsdal_mail-0.1.0/amsdal_mail/backends/console.py +91 -0
- amsdal_mail-0.1.0/amsdal_mail/backends/dummy.py +56 -0
- amsdal_mail-0.1.0/amsdal_mail/backends/ses.py +433 -0
- amsdal_mail-0.1.0/amsdal_mail/backends/smtp.py +305 -0
- amsdal_mail-0.1.0/amsdal_mail/events.py +46 -0
- amsdal_mail-0.1.0/amsdal_mail/exceptions.py +25 -0
- amsdal_mail-0.1.0/amsdal_mail/message.py +167 -0
- amsdal_mail-0.1.0/amsdal_mail/py.typed +0 -0
- amsdal_mail-0.1.0/amsdal_mail/settings.py +21 -0
- amsdal_mail-0.1.0/amsdal_mail/status.py +189 -0
- amsdal_mail-0.1.0/amsdal_mail/webhooks/__init__.py +0 -0
- amsdal_mail-0.1.0/amsdal_mail/webhooks/base.py +32 -0
- amsdal_mail-0.1.0/amsdal_mail/webhooks/handler.py +43 -0
- amsdal_mail-0.1.0/amsdal_mail/webhooks/listener.py +41 -0
- amsdal_mail-0.1.0/amsdal_mail/webhooks/registry.py +21 -0
- amsdal_mail-0.1.0/amsdal_mail/webhooks/ses.py +201 -0
- amsdal_mail-0.1.0/config.yml +20 -0
- amsdal_mail-0.1.0/docs/ARCHITECTURE.md +591 -0
- amsdal_mail-0.1.0/docs/README.md +71 -0
- amsdal_mail-0.1.0/docs/SMTP_USAGE.md +405 -0
- amsdal_mail-0.1.0/docs/TRACKING.md +214 -0
- amsdal_mail-0.1.0/license_check.py +38 -0
- amsdal_mail-0.1.0/pyproject.toml +179 -0
- amsdal_mail-0.1.0/scripts/extract_changelog.py +30 -0
- amsdal_mail-0.1.0/tests/__init__.py +1 -0
- amsdal_mail-0.1.0/tests/test_api.py +222 -0
- amsdal_mail-0.1.0/tests/test_backends.py +321 -0
- amsdal_mail-0.1.0/tests/test_exceptions.py +69 -0
- amsdal_mail-0.1.0/tests/test_message.py +620 -0
- amsdal_mail-0.1.0/tests/test_ses_backend.py +469 -0
- amsdal_mail-0.1.0/tests/test_webhooks.py +647 -0
- amsdal_mail-0.1.0/uv.lock +3195 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
license-check:
|
|
8
|
+
name: License check
|
|
9
|
+
runs-on: self-hosted
|
|
10
|
+
steps:
|
|
11
|
+
- name: Reset permissions
|
|
12
|
+
run: |
|
|
13
|
+
sudo chown -R $(id -u):$(id -g) .
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
|
+
|
|
16
|
+
- name: Python install
|
|
17
|
+
uses: actions/setup-python@v6
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.11"
|
|
20
|
+
- name: License check
|
|
21
|
+
run: |
|
|
22
|
+
pip install toml
|
|
23
|
+
python license_check.py
|
|
24
|
+
|
|
25
|
+
test-lint:
|
|
26
|
+
name: Run tests and check style
|
|
27
|
+
needs: [license-check]
|
|
28
|
+
runs-on: self-hosted
|
|
29
|
+
strategy:
|
|
30
|
+
max-parallel: 1
|
|
31
|
+
fail-fast: false
|
|
32
|
+
matrix:
|
|
33
|
+
python-version: ["3.11", "3.12"]
|
|
34
|
+
env:
|
|
35
|
+
PYTHON: ${{ matrix.python-version }}
|
|
36
|
+
DEPS: yes
|
|
37
|
+
_TYPER_FORCE_DISABLE_TERMINAL: true
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v5
|
|
40
|
+
- uses: szenius/set-timezone@v2.0
|
|
41
|
+
with:
|
|
42
|
+
timezoneLinux: "EEST"
|
|
43
|
+
|
|
44
|
+
- name: Set up python
|
|
45
|
+
uses: actions/setup-python@v6
|
|
46
|
+
with:
|
|
47
|
+
python-version: ${{ matrix.python-version }}
|
|
48
|
+
|
|
49
|
+
- name: Hatch and UV setup
|
|
50
|
+
run: |
|
|
51
|
+
pip install --upgrade uv hatch==1.14.2
|
|
52
|
+
hatch env prune
|
|
53
|
+
hatch env create
|
|
54
|
+
hatch run sync
|
|
55
|
+
|
|
56
|
+
- name: Run style checks
|
|
57
|
+
if: always()
|
|
58
|
+
run: hatch run all
|
|
59
|
+
|
|
60
|
+
- name: Run tests
|
|
61
|
+
if: always()
|
|
62
|
+
run: hatch run cov tests/
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
name: CD
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
license-check:
|
|
10
|
+
name: License check
|
|
11
|
+
runs-on: self-hosted
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v5
|
|
14
|
+
|
|
15
|
+
- name: Python install
|
|
16
|
+
uses: actions/setup-python@v6
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- name: License check
|
|
20
|
+
run: |
|
|
21
|
+
pip install toml
|
|
22
|
+
python license_check.py
|
|
23
|
+
|
|
24
|
+
build:
|
|
25
|
+
name: Build and compile
|
|
26
|
+
needs: [license-check]
|
|
27
|
+
runs-on: self-hosted
|
|
28
|
+
strategy:
|
|
29
|
+
fail-fast: false
|
|
30
|
+
matrix:
|
|
31
|
+
python-version: ["3.12"]
|
|
32
|
+
env:
|
|
33
|
+
PYTHON: ${{ matrix.python-version }}
|
|
34
|
+
DEPS: yes
|
|
35
|
+
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v5
|
|
38
|
+
|
|
39
|
+
- name: Set up python
|
|
40
|
+
uses: actions/setup-python@v6
|
|
41
|
+
with:
|
|
42
|
+
python-version: ${{ matrix.python-version }}
|
|
43
|
+
|
|
44
|
+
- name: Install hatch
|
|
45
|
+
run: |
|
|
46
|
+
python -m pip install --upgrade setuptools
|
|
47
|
+
python -m pip install --upgrade hatch==1.14.2
|
|
48
|
+
python -m pip install --upgrade uv
|
|
49
|
+
|
|
50
|
+
- name: Build
|
|
51
|
+
run: hatch build
|
|
52
|
+
|
|
53
|
+
- name: Store the distribution packages
|
|
54
|
+
uses: actions/upload-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: python-package-distributions
|
|
57
|
+
path: dist/
|
|
58
|
+
|
|
59
|
+
publish:
|
|
60
|
+
name: Publish to PyPi
|
|
61
|
+
runs-on: self-hosted
|
|
62
|
+
needs: build
|
|
63
|
+
strategy:
|
|
64
|
+
fail-fast: false
|
|
65
|
+
matrix:
|
|
66
|
+
python-version: ["3.12"]
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v5
|
|
69
|
+
|
|
70
|
+
- name: Set up python
|
|
71
|
+
uses: actions/setup-python@v6
|
|
72
|
+
with:
|
|
73
|
+
python-version: ${{ matrix.python-version }}
|
|
74
|
+
|
|
75
|
+
- name: Download all the dists
|
|
76
|
+
uses: actions/download-artifact@v4
|
|
77
|
+
with:
|
|
78
|
+
name: python-package-distributions
|
|
79
|
+
path: dist/
|
|
80
|
+
|
|
81
|
+
- name: Branch info
|
|
82
|
+
id: branch_info
|
|
83
|
+
run: |
|
|
84
|
+
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
85
|
+
|
|
86
|
+
- name: Extract changelog for release
|
|
87
|
+
id: changelog
|
|
88
|
+
run: |
|
|
89
|
+
python scripts/extract_changelog.py ${{ steps.branch_info.outputs.SOURCE_TAG }} > latest-changelogs.md
|
|
90
|
+
|
|
91
|
+
- name: Install hatch
|
|
92
|
+
run: |
|
|
93
|
+
python -m pip install --upgrade setuptools
|
|
94
|
+
python -m pip install --upgrade hatch==1.14.2
|
|
95
|
+
|
|
96
|
+
- name: Publish
|
|
97
|
+
run: |
|
|
98
|
+
hatch publish --user ${{ secrets.PYPI_USERNAME }} --auth ${{ secrets.PYPI_TOKEN }}
|
|
99
|
+
|
|
100
|
+
- name: Create Release
|
|
101
|
+
uses: softprops/action-gh-release@v2
|
|
102
|
+
with:
|
|
103
|
+
body_path: latest-changelogs.md
|
|
104
|
+
files: dist/*
|
|
105
|
+
name: ${{ steps.branch_info.outputs.SOURCE_TAG }}
|
|
106
|
+
draft: false
|
|
107
|
+
prerelease: false
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Tags Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
types: [closed]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
tags_check:
|
|
11
|
+
name: Tags Check
|
|
12
|
+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && startsWith(github.event.pull_request.head.ref, 'release/')
|
|
13
|
+
runs-on: self-hosted
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v5
|
|
16
|
+
with:
|
|
17
|
+
ref: main
|
|
18
|
+
token: ${{ secrets.ACCESS_KEY }}
|
|
19
|
+
|
|
20
|
+
- name: Create tag from version
|
|
21
|
+
env:
|
|
22
|
+
GITHUB_TOKEN: ${{ secrets.ACCESS_KEY }}
|
|
23
|
+
run: |
|
|
24
|
+
VERSION=$(python -c "exec(open('amsdal_mail/__about__.py').read()); print(__version__)")
|
|
25
|
+
TAG="v${VERSION}"
|
|
26
|
+
echo "Creating tag: ${TAG}"
|
|
27
|
+
git tag "${TAG}"
|
|
28
|
+
git push origin "${TAG}"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
venv/
|
|
3
|
+
/warehouse
|
|
4
|
+
.python-version
|
|
5
|
+
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*.pyo
|
|
9
|
+
*.pyd
|
|
10
|
+
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.coverage
|
|
13
|
+
.coverage.*
|
|
14
|
+
htmlcov/
|
|
15
|
+
.mypy_cache/
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
|
|
18
|
+
build/
|
|
19
|
+
dist/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
|
|
22
|
+
.vscode/
|
|
23
|
+
.idea/
|
|
24
|
+
*.code-workspace
|
|
25
|
+
.DS_Store
|
|
26
|
+
Thumbs.db
|
|
27
|
+
.claude/
|
|
28
|
+
.jbeval/
|
|
29
|
+
|
|
30
|
+
.env
|
|
31
|
+
.env.*
|
|
32
|
+
!.env.example
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/transactions/
|
|
36
|
+
/migrations/
|
|
37
|
+
/models/
|
|
38
|
+
/fixtures/
|
|
39
|
+
/static/
|
|
40
|
+
.tmp
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-02-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Core architecture with backend abstraction and registry pattern
|
|
12
|
+
- `send_mail()` and `asend_mail()` high-level API
|
|
13
|
+
- `EmailMessage` and `Attachment` Pydantic models with full validation
|
|
14
|
+
- `SendStatus` with per-recipient tracking (`is_success`, `has_failures`, etc.)
|
|
15
|
+
- Console backend for development and debugging
|
|
16
|
+
- Dummy backend for testing
|
|
17
|
+
- SMTP backend with TLS/SSL support and async via aiosmtplib
|
|
18
|
+
- AWS SES backend with boto3/aioboto3
|
|
19
|
+
- Template support with `template_id`, `merge_data`, `merge_global_data` (SES)
|
|
20
|
+
- Tags and metadata for email categorization and tracking
|
|
21
|
+
- Click and open tracking (`track_opens`, `track_clicks`)
|
|
22
|
+
- Inline images (CID) support via `Attachment.content_id`
|
|
23
|
+
- Webhook handlers for SES tracking events (bounce, complaint, delivery, etc.)
|
|
24
|
+
- Email tracking events via AMSDAL EventBus
|
|
25
|
+
- AMSDAL Framework integration via `MailAppConfig`
|
|
26
|
+
- Settings management via pydantic_settings
|
|
27
|
+
- Exception hierarchy: `EmailError`, `ConfigurationError`, `EmailConnectionError`, `SendError`
|