Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
run: pipx install poetry
- name: Install dependencies
run: poetry install
# tox.ini sets the placeholder settings the bundled project needs, and the
# [gh] section runs only the envs mapped to this job's interpreter -- one per
# Django release that supports it.
- name: Run tests
run: poetry run pytest
env:
VINTASEND_API_KEY: ci
NOTIFICATION_SERVICE_FACTORY: ci.factory
run: poetry run tox
1,699 changes: 865 additions & 834 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ classifiers = [
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Framework :: Django :: 6.0",
"Framework :: Django :: 6.1",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
Expand Down Expand Up @@ -60,7 +62,7 @@ include = [{ path = "openapi.yaml", format = "sdist" }]

[tool.poetry.dependencies]
vintasend = "3.5.0"
django = ">=4.2,<6.0"
django = ">=4.2,<6.2"
django-ninja = "^1.4.3"
requests = "^2.34.2"
# Reads the .env file in development. Production deployments set real environment
Expand All @@ -76,9 +78,9 @@ tox = "^4.55.0"
# Makes the [gh] section in tox.ini effective: each CI job then runs only the
# envs mapped to its interpreter instead of every env it can find one for.
tox-gh = "^1.8.0"
ruff = "^0.15.22"
ruff = "^0.17.3"
mypy = "^2.3.0"
django-stubs = "^5.2.0"
django-stubs = "^6.0.5"
types-requests = "^2.32.0"

[build-system]
Expand Down
23 changes: 18 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ envlist =
# The vintasend library supports 3.10-3.14, but this project is additionally
# bounded by Django: the 5.2 LTS line tops out at 3.13. Raise this when the
# Django constraint in pyproject.toml moves to a release that supports 3.14.
{py310,py311,py312,py313}
# Each factor pairs a Python with the Django releases that support it.
# Django 4.2 tops out at Python 3.12; Django 6.0+ requires Python 3.12.
py310-{django42,django52}
py311-{django42,django52}
py312-{django42,django52,django60,django61}
py313-{django52,django60,django61}
# Each CI matrix job installs only its own Python, so the other envs have no interpreter.
# Skip them instead of failing -- every version is still exercised by its own matrix job.
# Set explicitly rather than relying on the legacy-command default, which changed between
Expand All @@ -17,10 +22,10 @@ no_package = true

[gh]
python =
3.10 = py310
3.11 = py311
3.12 = py312
3.13 = py313
3.10 = py310-{django42,django52}
3.11 = py311-{django42,django52}
3.12 = py312-{django42,django52,django60,django61}
3.13 = py313-{django52,django60,django61}

[testenv]
description = run tests
Expand All @@ -37,6 +42,14 @@ setenv =
deps =
poetry
commands_pre =
# `poetry install` resolves Django from poetry.lock, which pins a single version.
# The factor pin therefore has to be installed AFTER it -- installing it first
# (via `deps`) means poetry silently replaces it and every env tests the locked
# version instead of the one named in the env.
poetry install --with dev
django42: python -m pip install "Django>=4.2,<4.3"
django52: python -m pip install "Django>=5.2,<5.3"
django60: python -m pip install "Django>=6.0,<6.1"
django61: python -m pip install "Django>=6.1,<6.2"
commands =
poetry run pytest -n auto --cov vintasend_api --cov-report=xml:coverage-{envname}.xml {posargs}
2 changes: 1 addition & 1 deletion vintasend_api/dashboard/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"configured_authenticator",
]

Authenticator = Callable[[HttpRequest], "None | Awaitable[None]"]
Authenticator = Callable[[HttpRequest], "Awaitable[None] | None"]

# The scheme is matched in any case, as RFC 9110 has it. `\s+` rather than one space, and the
# token stripped, so the answer is the same as the TypeScript twin's `bearerToken`.
Expand Down
2 changes: 1 addition & 1 deletion vintasend_api/dashboard/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

logger = logging.getLogger(__name__)

UnhandledErrorHandler = Callable[[Exception, HttpRequest, str], "None | Awaitable[None]"]
UnhandledErrorHandler = Callable[[Exception, HttpRequest, str], "Awaitable[None] | None"]

REQUEST_ID_HEADER = "X-Request-Id"

Expand Down
Loading