Skip to content

Commit a305c89

Browse files
authored
Merge branch 'master' into add-alls-green-job
2 parents eab2b2d + 4156ccb commit a305c89

File tree

14 files changed

+31
-42
lines changed

14 files changed

+31
-42
lines changed

Diff for: .github/workflows/test-suite.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1919
os: [windows-latest, ubuntu-latest, macos-latest]
2020
steps:
2121
- uses: "actions/checkout@v4"

Diff for: pyproject.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "The lightning-fast ASGI server."
99
readme = "README.md"
1010
license = "BSD-3-Clause"
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.9"
1212
authors = [
1313
{ name = "Tom Christie", email = "[email protected]" },
1414
{ name = "Marcelo Trylesinski", email = "[email protected]" },
@@ -20,7 +20,6 @@ classifiers = [
2020
"License :: OSI Approved :: BSD License",
2121
"Operating System :: OS Independent",
2222
"Programming Language :: Python :: 3",
23-
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
@@ -38,7 +37,7 @@ dependencies = [
3837

3938
[project.optional-dependencies]
4039
standard = [
41-
"colorama>=0.4;sys_platform == 'win32'",
40+
"colorama>=0.4; sys_platform == 'win32'",
4241
"httptools>=0.6.3",
4342
"python-dotenv>=0.13",
4443
"PyYAML>=5.1",
@@ -127,8 +126,6 @@ py-win32 = "sys_platform == 'win32'"
127126
py-not-win32 = "sys_platform != 'win32'"
128127
py-linux = "sys_platform == 'linux'"
129128
py-darwin = "sys_platform == 'darwin'"
130-
py-gte-38 = "sys_version_info >= (3, 8)"
131-
py-lt-38 = "sys_version_info < (3, 8)"
132129
py-gte-39 = "sys_version_info >= (3, 9)"
133130
py-lt-39 = "sys_version_info < (3, 9)"
134131
py-gte-310 = "sys_version_info >= (3, 10)"

Diff for: requirements.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ pytest-mock==3.14.0
2020
mypy==1.13.0
2121
types-click==7.1.8
2222
types-pyyaml==6.0.12.20240917
23-
trustme==1.1.0; python_version < '3.9'
24-
trustme==1.2.0; python_version >= '3.9'
23+
trustme==1.2.0
2524
cryptography==44.0.0
26-
coverage==7.6.1; python_version < '3.9'
27-
coverage==7.6.9; python_version >= '3.9'
25+
coverage==7.6.9
2826
coverage-conditional-plugin==0.9.0
2927
httpx==0.28.1
3028

Diff for: tests/middleware/test_wsgi.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import io
44
import sys
5-
from typing import AsyncGenerator, Callable
5+
from collections.abc import AsyncGenerator
6+
from typing import Callable
67

78
import a2wsgi
89
import httpx

Diff for: tests/supervisors/test_reload.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
import signal
55
import socket
66
import sys
7+
from collections.abc import Generator
78
from pathlib import Path
89
from threading import Thread
910
from time import sleep
10-
from typing import Callable, Generator
11+
from typing import Callable
1112

1213
import pytest
1314
from pytest_mock import MockerFixture

Diff for: tests/test_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import os
44
import platform
55
import sys
6+
from collections.abc import Iterator
67
from pathlib import Path
78
from textwrap import dedent
8-
from typing import Iterator
99
from unittest import mock
1010

1111
import pytest

Diff for: tests/test_server.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import logging
66
import signal
77
import sys
8-
from typing import Callable, ContextManager, Generator
8+
from collections.abc import Generator
9+
from contextlib import AbstractContextManager
10+
from typing import Callable
911

1012
import httpx
1113
import pytest
@@ -62,7 +64,7 @@ async def app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISendCallable
6264
@pytest.mark.parametrize("exception_signal", signals)
6365
@pytest.mark.parametrize("capture_signal", signal_captures)
6466
async def test_server_interrupt(
65-
exception_signal: signal.Signals, capture_signal: Callable[[signal.Signals], ContextManager[None]]
67+
exception_signal: signal.Signals, capture_signal: Callable[[signal.Signals], AbstractContextManager[None]]
6668
): # pragma: py-win32
6769
"""Test interrupting a Server that is run explicitly inside asyncio"""
6870

Diff for: uvicorn/_types.py

+5-17
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,8 @@
3232

3333
import sys
3434
import types
35-
from typing import (
36-
Any,
37-
Awaitable,
38-
Callable,
39-
Iterable,
40-
Literal,
41-
MutableMapping,
42-
Optional,
43-
Protocol,
44-
Tuple,
45-
Type,
46-
TypedDict,
47-
Union,
48-
)
35+
from collections.abc import Awaitable, Iterable, MutableMapping
36+
from typing import Any, Callable, Literal, Optional, Protocol, TypedDict, Union
4937

5038
if sys.version_info >= (3, 11): # pragma: py-lt-311
5139
from typing import NotRequired
@@ -54,8 +42,8 @@
5442

5543
# WSGI
5644
Environ = MutableMapping[str, Any]
57-
ExcInfo = Tuple[Type[BaseException], BaseException, Optional[types.TracebackType]]
58-
StartResponse = Callable[[str, Iterable[Tuple[str, str]], Optional[ExcInfo]], None]
45+
ExcInfo = tuple[type[BaseException], BaseException, Optional[types.TracebackType]]
46+
StartResponse = Callable[[str, Iterable[tuple[str, str]], Optional[ExcInfo]], None]
5947
WSGIApp = Callable[[Environ, StartResponse], Union[Iterable[bytes], BaseException]]
6048

6149

@@ -281,7 +269,7 @@ def __init__(self, scope: Scope) -> None: ... # pragma: no cover
281269
async def __call__(self, receive: ASGIReceiveCallable, send: ASGISendCallable) -> None: ... # pragma: no cover
282270

283271

284-
ASGI2Application = Type[ASGI2Protocol]
272+
ASGI2Application = type[ASGI2Protocol]
285273
ASGI3Application = Callable[
286274
[
287275
Scope,

Diff for: uvicorn/config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
import socket
1010
import ssl
1111
import sys
12+
from collections.abc import Awaitable
1213
from configparser import RawConfigParser
1314
from pathlib import Path
14-
from typing import IO, Any, Awaitable, Callable, Literal
15+
from typing import IO, Any, Callable, Literal
1516

1617
import click
1718

Diff for: uvicorn/middleware/wsgi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import warnings
88
from collections import deque
9-
from typing import Iterable
9+
from collections.abc import Iterable
1010

1111
from uvicorn._types import (
1212
ASGIReceiveCallable,

Diff for: uvicorn/protocols/websockets/websockets_impl.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import asyncio
44
import http
55
import logging
6-
from typing import Any, Literal, Optional, Sequence, cast
6+
from collections.abc import Sequence
7+
from typing import Any, Literal, Optional, cast
78
from urllib.parse import unquote
89

910
import websockets

Diff for: uvicorn/server.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
import sys
1111
import threading
1212
import time
13+
from collections.abc import Generator, Sequence
1314
from email.utils import formatdate
1415
from types import FrameType
15-
from typing import TYPE_CHECKING, Generator, Sequence, Union
16+
from typing import TYPE_CHECKING, Union
1617

1718
import click
1819

@@ -284,10 +285,7 @@ async def shutdown(self, sockets: list[socket.socket] | None = None) -> None:
284285
len(self.server_state.tasks),
285286
)
286287
for t in self.server_state.tasks:
287-
if sys.version_info < (3, 9): # pragma: py-gte-39
288-
t.cancel()
289-
else: # pragma: py-lt-39
290-
t.cancel(msg="Task cancelled, timeout graceful shutdown exceeded")
288+
t.cancel(msg="Task cancelled, timeout graceful shutdown exceeded")
291289

292290
# Send the lifespan shutdown event, and wait for application shutdown.
293291
if not self.force_exit:

Diff for: uvicorn/supervisors/basereload.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
import signal
66
import sys
77
import threading
8+
from collections.abc import Iterator
89
from pathlib import Path
910
from socket import socket
1011
from types import FrameType
11-
from typing import Callable, Iterator
12+
from typing import Callable
1213

1314
import click
1415

Diff for: uvicorn/supervisors/statreload.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from __future__ import annotations
22

33
import logging
4+
from collections.abc import Iterator
45
from pathlib import Path
56
from socket import socket
6-
from typing import Callable, Iterator
7+
from typing import Callable
78

89
from uvicorn.config import Config
910
from uvicorn.supervisors.basereload import BaseReload

0 commit comments

Comments
 (0)