Skip to content

Commit

Permalink
Drop Python 3.8 support (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored Oct 12, 2024
1 parent 6a0d30d commit 96ef5d7
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 667 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
strategy:
matrix:
python-version:
- 3.8
- 3.9
- '3.10'
- '3.11'
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.21.0
hooks:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Changelog
=========

* Drop Python 3.8 support.

* Support Python 3.13.

4.4.0 (2024-06-19)
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Some good resources to read on the subject are:
Requirements
------------

Python 3.8 to 3.13 supported.
Python 3.9 to 3.13 supported.

Django 3.2 to 5.1 supported.

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers = [
authors = [
{ name = "Otto Yiu", email = "[email protected]" },
]
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
Expand All @@ -38,7 +38,6 @@ classifiers = [
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
8 changes: 3 additions & 5 deletions src/corsheaders/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from __future__ import annotations

from typing import List
from typing import Pattern
from typing import Sequence
from typing import Tuple
from collections.abc import Sequence
from re import Pattern
from typing import Union
from typing import cast

Expand Down Expand Up @@ -53,7 +51,7 @@ def CORS_ALLOWED_ORIGINS(self) -> list[str] | tuple[str]:
"CORS_ALLOWED_ORIGINS",
getattr(settings, "CORS_ORIGIN_WHITELIST", ()),
)
return cast(Union[List[str], Tuple[str]], value)
return cast(Union[list[str], tuple[str]], value)

@property
def CORS_ALLOWED_ORIGIN_REGEXES(self) -> Sequence[str | Pattern[str]]:
Expand Down
2 changes: 1 addition & 1 deletion src/corsheaders/middleware.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import re
from typing import Awaitable
from collections.abc import Awaitable
from typing import Callable
from urllib.parse import SplitResult
from urllib.parse import urlsplit
Expand Down
40 changes: 0 additions & 40 deletions tests/requirements/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,6 @@
*sys.argv[1:],
]
run = partial(subprocess.run, check=True)
run(
[
*common_args,
"--python",
"3.8",
"--output-file",
"py38-django32.txt",
],
input=b"Django>=3.2a1,<3.3",
)
run(
[
*common_args,
"--python",
"3.8",
"--output-file",
"py38-django40.txt",
],
input=b"Django>=4.0a1,<4.1",
)
run(
[
*common_args,
"--python",
"3.8",
"--output-file",
"py38-django41.txt",
],
input=b"Django>=4.1a1,<4.2",
)
run(
[
*common_args,
"--python",
"3.8",
"--output-file",
"py38-django42.txt",
],
input=b"Django>=4.2a1,<5.0",
)
run(
[
*common_args,
Expand Down
143 changes: 0 additions & 143 deletions tests/requirements/py38-django32.txt

This file was deleted.

Loading

0 comments on commit 96ef5d7

Please sign in to comment.