Skip to content

Commit e2a9576

Browse files
author
Oleh Prypin
committed
Drop Python 3.7, officially support Python 3.12
1 parent cc76672 commit e2a9576

7 files changed

Lines changed: 15 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', pypy-3.9-v7.x]
10+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-v7.x']
1111
os: [ubuntu-latest, windows-latest, macos-latest]
1212
include:
1313
- python-version: pypy-3.9-v7.x
1414
py: pypy3
1515
# Just to slim down the test matrix:
1616
exclude:
17-
- python-version: 3.8
17+
- python-version: '3.9'
1818
os: macos-latest
19-
- python-version: 3.8
19+
- python-version: '3.9'
2020
os: windows-latest
21-
- python-version: 3.9
21+
- python-version: '3.10'
2222
os: ubuntu-latest
23-
- python-version: 3.10
23+
- python-version: '3.11'
2424
os: macos-latest
25-
- python-version: 3.10
25+
- python-version: '3.11'
2626
os: windows-latest
2727
runs-on: ${{ matrix.os }}
2828
steps:

mkdocs/commands/get_deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def strings(obj) -> Sequence[str]:
7070
return tuple(obj)
7171

7272

73-
@functools.lru_cache()
73+
@functools.lru_cache
7474
def _entry_points(group: str) -> Mapping[str, EntryPoint]:
7575
eps = {ep.name: ep for ep in entry_points(group=group)}
7676
log.debug(f"Available '{group}' entry points: {sorted(eps)}")

mkdocs/livereload/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def _inject_js_into_html(self, content, epoch):
327327
)
328328

329329
@classmethod
330-
@functools.lru_cache() # "Cache" to not repeat the same message for the same browser tab.
330+
@functools.lru_cache # "Cache" to not repeat the same message for the same browser tab.
331331
def _log_poll_request(cls, url, request_id):
332332
log.info(f"Browser connected: {url}")
333333

mkdocs/plugins.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import logging
88
import sys
9-
from typing import TYPE_CHECKING, Any, Callable, Generic, MutableMapping, TypeVar, overload
9+
from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, MutableMapping, TypeVar, overload
1010

1111
if sys.version_info >= (3, 10):
1212
from importlib.metadata import EntryPoint, entry_points
@@ -16,11 +16,6 @@
1616
if TYPE_CHECKING:
1717
import jinja2.environment
1818

19-
if sys.version_info >= (3, 8):
20-
from typing import Literal
21-
else:
22-
from typing_extensions import Literal
23-
2419
from mkdocs import utils
2520
from mkdocs.config.base import Config, ConfigErrors, ConfigWarnings, LegacyConfig, PlainConfigSchema
2621

mkdocs/structure/toc.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
"""
88
from __future__ import annotations
99

10-
import sys
11-
from typing import Iterable, Iterator
12-
13-
if sys.version_info >= (3, 8):
14-
from typing import TypedDict
15-
else:
16-
from typing_extensions import TypedDict
10+
from typing import Iterable, Iterator, TypedDict
1711

1812

1913
class _TocToken(TypedDict):

mkdocs/utils/templates.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
from __future__ import annotations
22

3-
import sys
4-
from typing import TYPE_CHECKING, Sequence
5-
6-
if sys.version_info >= (3, 8):
7-
from typing import TypedDict
8-
else:
9-
from typing_extensions import TypedDict
3+
from typing import TYPE_CHECKING, Sequence, TypedDict
104

115
if TYPE_CHECKING:
126
import datetime

pyproject.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ classifiers = [
1919
"Operating System :: OS Independent",
2020
"Programming Language :: Python",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.7",
2322
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
2727
"Programming Language :: Python :: 3 :: Only",
2828
"Programming Language :: Python :: Implementation :: CPython",
2929
"Programming Language :: Python :: Implementation :: PyPy",
3030
"Topic :: Documentation",
3131
"Topic :: Text Processing",
3232
]
3333
dynamic = ["version"]
34-
requires-python = ">=3.7"
34+
requires-python = ">=3.8"
3535
dependencies = [
3636
"click >=7.0",
3737
"Jinja2 >=2.11.1",
@@ -42,7 +42,6 @@ dependencies = [
4242
"ghp-import >=1.0",
4343
"pyyaml_env_tag >=0.1",
4444
"importlib-metadata >=4.3; python_version < '3.10'",
45-
"typing-extensions >=3.10; python_version < '3.8'",
4645
"packaging >=20.5",
4746
"mergedeep >=1.3.4",
4847
"pathspec >=0.11.1",
@@ -64,7 +63,6 @@ min-versions = [
6463
"ghp-import ==1.0",
6564
"pyyaml_env_tag ==0.1",
6665
"importlib-metadata ==4.3; python_version < '3.10'",
67-
"typing-extensions ==3.10; python_version < '3.8'",
6866
"packaging ==20.5",
6967
"mergedeep ==1.3.4",
7068
"pathspec ==0.11.1",
@@ -127,7 +125,7 @@ _coverage = [
127125
]
128126
with-coverage = "test"
129127
[[tool.hatch.envs.test.matrix]]
130-
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"]
128+
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"]
131129
type = ["default", "min-req"]
132130
[tool.hatch.envs.test.overrides]
133131
matrix.type.features = [
@@ -142,7 +140,7 @@ template = "docs"
142140
[tool.hatch.envs.integration.scripts]
143141
test = "python -m mkdocs.tests.integration"
144142
[[tool.hatch.envs.integration.matrix]]
145-
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"]
143+
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"]
146144
type = ["default", "no-babel"]
147145
[tool.hatch.envs.integration.overrides]
148146
matrix.type.features = [
@@ -212,7 +210,6 @@ dependencies = [
212210

213211
[tool.black]
214212
line-length = 100
215-
target-version = ["py37"] # 3.7
216213
skip-string-normalization = true
217214

218215
[tool.isort]

0 commit comments

Comments
 (0)