| 1 |
version: 2.1 |
| 2 |
|
| 3 |
orbs: |
| 4 |
codecov: codecov/[email protected] |
| 5 |
|
| 6 |
executors: |
| 7 |
# Pin the uv version: the unversioned bookworm tags stopped updating in |
| 8 |
# early 2026 and ship a uv too old to know about current 3.15 builds. |
| 9 |
cpython_executor: |
| 10 |
docker: |
| 11 |
- image: "ghcr.io/astral-sh/uv:0.12.10-python3.12-trixie" |
| 12 |
resource_class: small |
| 13 |
environment: |
| 14 |
FORCE_COLOR: "1" |
| 15 |
uv_executor: |
| 16 |
docker: |
| 17 |
- image: "ghcr.io/astral-sh/uv:0.12.10-trixie" |
| 18 |
resource_class: small |
| 19 |
environment: |
| 20 |
FORCE_COLOR: "1" |
| 21 |
pypy_executor: |
| 22 |
docker: |
| 23 |
- image: "pypy:3.11-bookworm" |
| 24 |
auth: |
| 25 |
username: $DOCKERHUB_USERNAME |
| 26 |
password: $DOCKERHUB_PASSWORD |
| 27 |
resource_class: small |
| 28 |
environment: |
| 29 |
FORCE_COLOR: "1" |
| 30 |
PIP_ROOT_USER_ACTION: "ignore" |
| 31 |
|
| 32 |
jobs: |
| 33 |
build: |
| 34 |
executor: |
| 35 |
name: cpython_executor |
| 36 |
steps: |
| 37 |
- checkout |
| 38 |
- run: uv build |
| 39 |
- persist_to_workspace: |
| 40 |
root: dist |
| 41 |
paths: |
| 42 |
- aiosmtplib-*.tar.gz |
| 43 |
- aiosmtplib-*.whl |
| 44 |
- store_artifacts: |
| 45 |
path: dist/ |
| 46 |
|
| 47 |
buildcheck: |
| 48 |
executor: |
| 49 |
name: cpython_executor |
| 50 |
steps: |
| 51 |
- checkout |
| 52 |
- attach_workspace: |
| 53 |
at: dist |
| 54 |
- run: uv tool run --from poethepoet poe buildcheck |
| 55 |
|
| 56 |
typecheck: |
| 57 |
executor: |
| 58 |
name: cpython_executor |
| 59 |
steps: |
| 60 |
- checkout |
| 61 |
- run: uv tool run --from poethepoet poe typecheck |
| 62 |
|
| 63 |
security: |
| 64 |
executor: |
| 65 |
name: cpython_executor |
| 66 |
steps: |
| 67 |
- checkout |
| 68 |
- run: uv tool run --from poethepoet poe security |
| 69 |
|
| 70 |
docs: |
| 71 |
executor: |
| 72 |
name: cpython_executor |
| 73 |
steps: |
| 74 |
- checkout |
| 75 |
- attach_workspace: |
| 76 |
at: dist |
| 77 |
- run: uv venv |
| 78 |
- run: uv pip install -r docs/requirements.txt |
| 79 |
- run: uv pip install -r requirements-dev.txt |
| 80 |
- run: uv pip install dist/*.whl |
| 81 |
- run: uv run python -m sphinx -nWT -b doctest -d ./docs/build/doctrees ./docs ./docs/build/html |
| 82 |
- run: uv run python -m sphinx -nWT -b dummy -d ./docs/build/doctrees ./docs ./docs/build/html |
| 83 |
|
| 84 |
test: |
| 85 |
executor: |
| 86 |
name: uv_executor |
| 87 |
parameters: |
| 88 |
python_version: |
| 89 |
type: enum |
| 90 |
description: "uv python version request (t suffix = free-threaded)" |
| 91 |
enum: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15", "3.14t", "3.15t"] |
| 92 |
event_loop: |
| 93 |
type: enum |
| 94 |
description: "event loop type" |
| 95 |
enum: ["asyncio", "uvloop"] |
| 96 |
environment: |
| 97 |
COVERAGE_FILE: "coverage-results/.coverage.cpython<<parameters.python_version>>-<<parameters.event_loop>>" |
| 98 |
HYPOTHESIS_PROFILE: "ci" |
| 99 |
BIND_ADDR: "127.0.0.1" |
| 100 |
steps: |
| 101 |
- checkout |
| 102 |
- attach_workspace: |
| 103 |
at: dist |
| 104 |
- run: uv python install <<parameters.python_version>> |
| 105 |
- run: uv venv --python=<<parameters.python_version>> |
| 106 |
- run: uv run --no-project -- python -VV |
| 107 |
- run: uv pip install -r requirements-dev.txt |
| 108 |
- when: |
| 109 |
condition: |
| 110 |
equal: ["uvloop", <<parameters.event_loop>>] |
| 111 |
steps: |
| 112 |
- run: uv pip install $(find dist -name aiosmtplib-*.whl)[uvloop] |
| 113 |
- unless: |
| 114 |
condition: |
| 115 |
equal: ["uvloop", <<parameters.event_loop>>] |
| 116 |
steps: |
| 117 |
- run: uv pip install $(find dist -name aiosmtplib-*.whl) |
| 118 |
- run: | |
| 119 |
uv run --no-project -- python -m pytest \ |
| 120 |
--cov \ |
| 121 |
--cov-report=xml:coverage-results/coverage-cpython<<parameters.python_version>>-<<parameters.event_loop>>.xml \ |
| 122 |
--cov-config=pyproject.toml \ |
| 123 |
--junitxml=test-results/junit-cpython<<parameters.python_version>>-<<parameters.event_loop>>.xml \ |
| 124 |
--override-ini=pythonpath= \ |
| 125 |
--event-loop=<<parameters.event_loop>> \ |
| 126 |
--bind-addr=$BIND_ADDR \ |
| 127 |
--hypothesis-profile $HYPOTHESIS_PROFILE |
| 128 |
- store_artifacts: |
| 129 |
path: test-results |
| 130 |
- store_test_results: |
| 131 |
path: test-results |
| 132 |
- persist_to_workspace: |
| 133 |
root: coverage-results |
| 134 |
paths: |
| 135 |
- .coverage.* |
| 136 |
- codecov/upload: |
| 137 |
report_type: test_results |
| 138 |
disable_search: true |
| 139 |
files: "test-results/junit-cpython<<parameters.python_version>>-<<parameters.event_loop>>.xml" |
| 140 |
flags: "cpython<<parameters.python_version>>,<<parameters.event_loop>>" |
| 141 |
- codecov/upload: |
| 142 |
report_type: coverage |
| 143 |
disable_search: true |
| 144 |
files: "coverage-results/coverage-cpython<<parameters.python_version>>-<<parameters.event_loop>>.xml" |
| 145 |
flags: "cpython<<parameters.python_version>>,<<parameters.event_loop>>" |
| 146 |
|
| 147 |
test-pypy: |
| 148 |
executor: |
| 149 |
name: pypy_executor |
| 150 |
environment: |
| 151 |
COVERAGE_FILE: "coverage-results/.coverage.pypy3.11-asyncio" |
| 152 |
HYPOTHESIS_PROFILE: "ci" |
| 153 |
BIND_ADDR: "127.0.0.1" |
| 154 |
steps: |
| 155 |
- checkout |
| 156 |
- attach_workspace: |
| 157 |
at: dist |
| 158 |
- run: python -m pip install -r requirements-dev.txt |
| 159 |
- run: python -m pip install dist/*.whl |
| 160 |
- run: | |
| 161 |
python -m pytest --cov \ |
| 162 |
--cov-report=xml:coverage-results/coverage-pypy3.11-asyncio.xml \ |
| 163 |
--cov-config=pyproject.toml \ |
| 164 |
--junitxml=test-results/junit-pypy3.11-asyncio.xml \ |
| 165 |
--override-ini=pythonpath= \ |
| 166 |
--event-loop=asyncio \ |
| 167 |
--bind-addr=$BIND_ADDR \ |
| 168 |
--hypothesis-profile $HYPOTHESIS_PROFILE |
| 169 |
- store_artifacts: |
| 170 |
path: test-results |
| 171 |
- store_test_results: |
| 172 |
path: test-results |
| 173 |
- persist_to_workspace: |
| 174 |
root: coverage-results |
| 175 |
paths: |
| 176 |
- .coverage.* |
| 177 |
- codecov/upload: |
| 178 |
report_type: test_results |
| 179 |
disable_search: true |
| 180 |
files: "test-results/junit-pypy3.11-asyncio.xml" |
| 181 |
flags: "pypy3.11,asyncio" |
| 182 |
- codecov/upload: |
| 183 |
report_type: coverage |
| 184 |
disable_search: true |
| 185 |
files: "coverage-results/coverage-pypy3.11-asyncio.xml" |
| 186 |
flags: "pypy3.11,asyncio" |
| 187 |
|
| 188 |
coverage: |
| 189 |
executor: |
| 190 |
name: cpython_executor |
| 191 |
environment: |
| 192 |
COVERAGE_FILE: .coverage |
| 193 |
steps: |
| 194 |
- checkout |
| 195 |
- attach_workspace: |
| 196 |
at: coverage-results |
| 197 |
- run: cp coverage-results/.coverage.* ./ |
| 198 |
- run: uv tool run coverage combine |
| 199 |
- run: uv tool run coverage xml |
| 200 |
- run: uv tool run coverage html |
| 201 |
- store_artifacts: |
| 202 |
path: coverage.xml |
| 203 |
- store_artifacts: |
| 204 |
path: htmlcov |
| 205 |
- run: uv tool run coverage report --fail-under=100 |
| 206 |
|
| 207 |
workflows: |
| 208 |
build_test: |
| 209 |
jobs: |
| 210 |
- build: &base-job |
| 211 |
context: |
| 212 |
- docker-hub-credentials |
| 213 |
filters: |
| 214 |
tags: |
| 215 |
only: /.*/ |
| 216 |
- buildcheck: |
| 217 |
<<: *base-job |
| 218 |
requires: |
| 219 |
- build |
| 220 |
- docs: |
| 221 |
<<: *base-job |
| 222 |
requires: |
| 223 |
- build |
| 224 |
- test-pypy: |
| 225 |
<<: *base-job |
| 226 |
name: "test-asyncio-pypy3.11" |
| 227 |
requires: |
| 228 |
- build |
| 229 |
- test: |
| 230 |
<<: *base-job |
| 231 |
name: "test-asyncio-<< matrix.python_version >>" |
| 232 |
matrix: |
| 233 |
alias: "test-cpython-asyncio" |
| 234 |
parameters: |
| 235 |
event_loop: ["asyncio"] |
| 236 |
# uvloop has no wheels for 3.15 or free-threaded builds, so |
| 237 |
# those run asyncio only. 3.13t is skipped because cffi (via |
| 238 |
# trustme) does not support it. |
| 239 |
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15", "3.14t", "3.15t"] |
| 240 |
requires: |
| 241 |
- build |
| 242 |
- test: |
| 243 |
<<: *base-job |
| 244 |
name: "test-uvloop-<< matrix.python_version >>" |
| 245 |
matrix: |
| 246 |
alias: "test-cpython-uvloop" |
| 247 |
parameters: |
| 248 |
event_loop: ["uvloop"] |
| 249 |
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 250 |
requires: |
| 251 |
- build |
| 252 |
- "test-asyncio-<< matrix.python_version >>" |
| 253 |
- coverage: |
| 254 |
<<: *base-job |
| 255 |
requires: |
| 256 |
- test-cpython-asyncio |
| 257 |
- test-cpython-uvloop |
| 258 |
- test-asyncio-pypy3.11 |
| 259 |
lint: |
| 260 |
jobs: |
| 261 |
- typecheck: |
| 262 |
<<: *base-job |
| 263 |
- security: |
| 264 |
<<: *base-job |
| 265 |
# VS Code Extension Version: 1.5.1 |