Skip to content

Commit 62feeae

Browse files
🏗️ Update project tooling and support Python 3.13 lifespans
* `asyncio.get_event_loop()` is deprecated in python 3.13, so switch to `asyncio.get_running_loop()` so lifespans still work in python 3.13 * switch to uv for package management (keep publishing still with twine) * use ruff for formatting * switched testing to tox, for easier anvironment handeling across machines * set test coverage to 90%
1 parent e99dce7 commit 62feeae

14 files changed

Lines changed: 234 additions & 2118 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,15 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Python
13-
uses: actions/setup-python@v2
11+
- uses: actions/checkout@v4
12+
- name: Set up uv
13+
uses: astral-sh/setup-uv@v5
1414
with:
15-
python-version: "3.8"
16-
17-
- name: Install dependencies
18-
run: |
19-
pip install poetry twine
20-
poetry install --only main
21-
15+
python-version: "3.13"
2216
- name: Build
23-
run: poetry build
24-
17+
run: uv build
2518
- name: Publish
2619
env:
2720
TWINE_USERNAME: __token__
2821
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
29-
run: |
30-
twine upload dist/* --username $TWINE_USERNAME --password $TWINE_PASSWORD
22+
run: uvx twine upload dist/*

.github/workflows/test.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,43 @@ on:
1010
- synchronize
1111

1212
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up uv
18+
uses: astral-sh/setup-uv@v5
19+
with:
20+
python-version: "3.13"
21+
- name: Install tox
22+
run: uv tool install tox --with tox-uv
23+
- name: Lint
24+
run: tox -e lint
25+
1326
test:
1427
runs-on: ubuntu-latest
1528
strategy:
1629
matrix:
17-
python-version:
18-
- "3.12"
19-
- "3.11"
20-
- "3.10"
21-
- "3.9"
22-
- "3.8"
30+
include:
31+
- python-version: "3.13"
32+
tox-env: "py313"
33+
- python-version: "3.12"
34+
tox-env: "py312"
35+
- python-version: "3.11"
36+
tox-env: "py311"
37+
- python-version: "3.10"
38+
tox-env: "py310"
39+
- python-version: "3.9"
40+
tox-env: "py39"
41+
- python-version: "3.8"
42+
tox-env: "py38"
2343
steps:
2444
- uses: actions/checkout@v4
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
45+
- name: Set up uv
46+
uses: astral-sh/setup-uv@v5
2747
with:
2848
python-version: ${{ matrix.python-version }}
29-
- name: Install dependencies
30-
run: |
31-
pip install poetry
32-
poetry install
49+
- name: Install tox
50+
run: uv tool install tox --with tox-uv
3351
- name: Test
34-
run: bash scripts/test.sh
35-
env:
36-
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
52+
run: tox -e ${{ matrix.tox-env }}

poetry.lock

Lines changed: 0 additions & 1912 deletions
This file was deleted.

pyproject.toml

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
[tool.poetry]
1+
[project]
22
name = "vellox"
3-
version = "0.1.3"
3+
version = "0.2.0"
44
description = "GCP Cloud Functions support for ASGI applications"
5-
authors = ["junah201 <junah.dev@gmail.com>"]
6-
license = "MIT"
5+
authors = [
6+
{name = "junah201", email = "junah.dev@gmail.com"},
7+
]
8+
license = {text = "MIT"}
79
readme = "README.md"
8-
homepage = "https://vellox.junah.dev"
9-
repository = "https://github.com/junah201/vellox"
10-
documentation = "https://vellox.junah.dev"
10+
requires-python = ">=3.8"
1111
classifiers = [
1212
"License :: OSI Approved :: MIT License",
1313
"Operating System :: OS Independent",
@@ -17,33 +17,29 @@ classifiers = [
1717
"Programming Language :: Python :: 3.10",
1818
"Programming Language :: Python :: 3.11",
1919
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
21+
]
22+
dependencies = [
23+
"flask>=2.2.5,<3.0.0",
24+
"typing_extensions>=4.7.1,<5",
2025
]
2126

22-
23-
[tool.poetry.dependencies]
24-
python = ">=3.8"
25-
26-
Flask = "==2.2.5"
27-
typing_extensions = ">=4.7.1,<5"
28-
29-
30-
[tool.poetry.group.docs.dependencies]
31-
mkdocs = "^1.5.3"
32-
mkdocs-material = "^9.5.17"
33-
mkdocstrings = "^0.24.3"
34-
mkautodoc = "^0.2.0"
35-
36-
37-
38-
[tool.poetry.group.test.dependencies]
39-
pytest = "^8.2.2"
40-
pytest-cov = "^5.0.0"
41-
fastapi = "^0.111.0"
42-
starlette = "^0.37.2"
27+
[project.urls]
28+
Homepage = "https://vellox.junah.dev"
29+
Repository = "https://github.com/junah201/vellox"
30+
Documentation = "https://vellox.junah.dev"
31+
32+
[project.optional-dependencies]
33+
docs = [
34+
"mkdocs>=1.5.3,<2",
35+
"mkdocs-material>=9.5.17,<10",
36+
"mkdocstrings>=0.24.3,<1",
37+
"mkautodoc>=0.2.0,<1",
38+
]
4339

4440
[build-system]
45-
requires = ["poetry-core"]
46-
build-backend = "poetry.core.masonry.api"
41+
requires = ["hatchling"]
42+
build-backend = "hatchling.build"
4743

4844

4945
[tool.ruff]

scripts/test.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/test_adapter.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@
55
from vellox.exceptions import ConfigurationError
66

77

8-
async def app(scope, receive, send):
9-
...
8+
async def app(scope, receive, send): ...
109

1110

1211
def test_default_settings():
1312
handler = Vellox(app)
1413

1514
assert handler.lifespan == "auto"
16-
assert handler.config["base_path"] == '/'
17-
assert sorted(
18-
handler.config["text_mime_types"]
19-
) == sorted(DEFAULT_TEXT_MIME_TYPES)
15+
assert handler.config["base_path"] == "/"
16+
assert sorted(handler.config["text_mime_types"]) == sorted(DEFAULT_TEXT_MIME_TYPES)
2017
assert handler.config["exclude_headers"] == []
2118

2219

0 commit comments

Comments
 (0)