Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Python 3.7 #1996

Merged
merged 1 commit into from
Jun 19, 2023
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
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
4 changes: 1 addition & 3 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
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 @@ -26,11 +26,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


@pytest.fixture
def mocked_logging_config_module(mocker: MockerFixture) -> MagicMock:
Expand Down
9 changes: 2 additions & 7 deletions uvicorn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,18 @@
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._types import ASGIApplication
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())
8 changes: 1 addition & 7 deletions uvicorn/protocols/http/h11_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 (
Any,
Callable,
Dict,
List,
Literal,
Optional,
Tuple,
Union,
Expand Down Expand Up @@ -44,12 +44,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


H11Event = Union[
h11.Request,
h11.InformationalResponse,
Expand Down
8 changes: 1 addition & 7 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 @@ -12,6 +11,7 @@
Deque,
Dict,
List,
Literal,
Optional,
Tuple,
Union,
Expand Down Expand Up @@ -47,12 +47,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


HEADER_RE = re.compile(b'[\x00-\x1F\x7F()<>@,;:[]={} \t\\"]')
HEADER_VALUE_RE = re.compile(b"[\x00-\x1F\x7F]")

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,11 +1,11 @@
import asyncio
import http
import logging
import sys
from typing import (
Any,
Dict,
List,
Literal,
Optional,
Sequence,
Tuple,
Expand Down Expand Up @@ -42,11 +42,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


class Server:
closing = False
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 @@ -29,11 +29,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


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