Skip to content

Commit

Permalink
Drop support for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Jun 7, 2023
1 parent 3924ef4 commit 1adb1c2
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: 3.7
python-version: "3.8"
- name: "Install dependencies"
run: "scripts/install"
- name: "Build package & docs"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: "actions/checkout@v3"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

**Documentation**: [https://www.uvicorn.org](https://www.uvicorn.org)

**Requirements**: Python 3.7+ (For Python 3.6 support, install version 0.16.0.)
**Requirements**: Python 3.8+

Uvicorn is an ASGI web server implementation for Python.

Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ["version"]
description = "The lightning-fast ASGI server."
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.7"
requires-python = ">=3.8"
authors = [
{ name = "Tom Christie", email = "tom@tomchristie.com" },
]
Expand All @@ -19,7 +19,6 @@ classifiers = [
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -31,7 +30,6 @@ classifiers = [
dependencies = [
"click>=7.0",
"h11>=0.8",
"typing-extensions;python_version < '3.8'",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -115,7 +113,5 @@ py-win32 = "sys_platform == 'win32'"
py-not-win32 = "sys_platform != 'win32'"
py-linux = "sys_platform == 'linux'"
py-darwin = "sys_platform == 'darwin'"
py-gte-38 = "sys_version_info >= (3, 8)"
py-lt-38 = "sys_version_info < (3, 8)"
py-gte-39 = "sys_version_info < (3, 9)"
py-lt-39 = "sys_version_info < (3, 9)"
7 changes: 1 addition & 6 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import typing
from pathlib import Path
from typing import Optional
from typing import Literal, Optional
from unittest.mock import MagicMock

import pytest
Expand All @@ -19,11 +19,6 @@
from uvicorn.middleware.wsgi import WSGIMiddleware
from uvicorn.protocols.http.h11_impl import H11Protocol

if sys.version_info < (3, 8): # pragma: py-gte-38
from typing_extensions import Literal
else: # pragma: py-lt-38
from typing import Literal

if typing.TYPE_CHECKING:
from asgiref.typing import (
ASGIApplication,
Expand Down
9 changes: 2 additions & 7 deletions uvicorn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,17 @@
Callable,
Dict,
List,
Literal,
Optional,
Tuple,
Type,
Union,
)

from uvicorn.logging import TRACE_LOG_LEVEL

if sys.version_info < (3, 8): # pragma: py-gte-38
from typing_extensions import Literal
else: # pragma: py-lt-38
from typing import Literal

import click

from uvicorn.importer import ImportFromStringError, import_from_string
from uvicorn.logging import TRACE_LOG_LEVEL
from uvicorn.middleware.asgi2 import ASGI2Middleware
from uvicorn.middleware.message_logger import MessageLoggerMiddleware
from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware
Expand Down
7 changes: 1 addition & 6 deletions uvicorn/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
import logging
import sys
from copy import copy
from typing import Optional
from typing import Literal, Optional

import click

if sys.version_info < (3, 8): # pragma: py-gte-38
from typing_extensions import Literal
else: # pragma: py-lt-38
from typing import Literal

TRACE_LOG_LEVEL = 5


Expand Down
2 changes: 1 addition & 1 deletion uvicorn/loops/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@


def asyncio_setup(use_subprocess: bool = False) -> None: # pragma: no cover
if sys.version_info >= (3, 8) and sys.platform == "win32" and use_subprocess:
if sys.platform == "win32" and use_subprocess:
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
7 changes: 1 addition & 6 deletions uvicorn/protocols/http/h11_impl.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import asyncio
import http
import logging
import sys
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Literal,
Optional,
Tuple,
Union,
Expand Down Expand Up @@ -35,11 +35,6 @@
)
from uvicorn.server import ServerState

if sys.version_info < (3, 8): # pragma: py-gte-38
from typing_extensions import Literal
else: # pragma: py-lt-38
from typing import Literal

if TYPE_CHECKING:
from asgiref.typing import (
ASGI3Application,
Expand Down
7 changes: 1 addition & 6 deletions uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import http
import logging
import re
import sys
import urllib
from asyncio.events import TimerHandle
from collections import deque
Expand All @@ -13,6 +12,7 @@
Deque,
Dict,
List,
Literal,
Optional,
Tuple,
Union,
Expand All @@ -38,11 +38,6 @@
)
from uvicorn.server import ServerState

if sys.version_info < (3, 8): # pragma: py-gte-38
from typing_extensions import Literal
else: # pragma: py-lt-38
from typing import Literal

if TYPE_CHECKING:
from asgiref.typing import (
ASGI3Application,
Expand Down
7 changes: 1 addition & 6 deletions uvicorn/protocols/websockets/websockets_impl.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import asyncio
import http
import logging
import sys
from typing import (
TYPE_CHECKING,
Any,
Dict,
List,
Literal,
Optional,
Sequence,
Tuple,
Expand All @@ -33,11 +33,6 @@
)
from uvicorn.server import ServerState

if sys.version_info < (3, 8): # pragma: py-gte-38
from typing_extensions import Literal
else: # pragma: py-lt-38
from typing import Literal

if TYPE_CHECKING:
from asgiref.typing import (
ASGISendEvent,
Expand Down
7 changes: 1 addition & 6 deletions uvicorn/protocols/websockets/wsproto_impl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import logging
import sys
import typing
from typing import Literal
from urllib.parse import unquote

import wsproto
Expand Down Expand Up @@ -38,11 +38,6 @@
"WebSocketConnectEvent",
]

if sys.version_info < (3, 8): # pragma: py-gte-38
from typing_extensions import Literal
else: # pragma: py-lt-38
from typing import Literal


class WSProtocol(asyncio.Protocol):
def __init__(
Expand Down

0 comments on commit 1adb1c2

Please sign in to comment.