Drop Python 3.7, officially support Python 3.12

This commit is contained in:
Oleh Prypin
2023-10-14 12:53:01 +02:00
parent cc76672d55
commit e2a9576b24
7 changed files with 15 additions and 35 deletions

View File

@@ -7,22 +7,22 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', pypy-3.9-v7.x]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-v7.x']
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- python-version: pypy-3.9-v7.x
py: pypy3
# Just to slim down the test matrix:
exclude:
- python-version: 3.8
- python-version: '3.9'
os: macos-latest
- python-version: 3.8
- python-version: '3.9'
os: windows-latest
- python-version: 3.9
- python-version: '3.10'
os: ubuntu-latest
- python-version: 3.10
- python-version: '3.11'
os: macos-latest
- python-version: 3.10
- python-version: '3.11'
os: windows-latest
runs-on: ${{ matrix.os }}
steps:

View File

@@ -70,7 +70,7 @@ def strings(obj) -> Sequence[str]:
return tuple(obj)
@functools.lru_cache()
@functools.lru_cache
def _entry_points(group: str) -> Mapping[str, EntryPoint]:
eps = {ep.name: ep for ep in entry_points(group=group)}
log.debug(f"Available '{group}' entry points: {sorted(eps)}")

View File

@@ -327,7 +327,7 @@ class LiveReloadServer(socketserver.ThreadingMixIn, wsgiref.simple_server.WSGISe
)
@classmethod
@functools.lru_cache() # "Cache" to not repeat the same message for the same browser tab.
@functools.lru_cache # "Cache" to not repeat the same message for the same browser tab.
def _log_poll_request(cls, url, request_id):
log.info(f"Browser connected: {url}")

View File

@@ -6,7 +6,7 @@ from __future__ import annotations
import logging
import sys
from typing import TYPE_CHECKING, Any, Callable, Generic, MutableMapping, TypeVar, overload
from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, MutableMapping, TypeVar, overload
if sys.version_info >= (3, 10):
from importlib.metadata import EntryPoint, entry_points
@@ -16,11 +16,6 @@ else:
if TYPE_CHECKING:
import jinja2.environment
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal
from mkdocs import utils
from mkdocs.config.base import Config, ConfigErrors, ConfigWarnings, LegacyConfig, PlainConfigSchema

View File

@@ -7,13 +7,7 @@ maintain compatibility with older versions of MkDocs.
"""
from __future__ import annotations
import sys
from typing import Iterable, Iterator
if sys.version_info >= (3, 8):
from typing import TypedDict
else:
from typing_extensions import TypedDict
from typing import Iterable, Iterator, TypedDict
class _TocToken(TypedDict):

View File

@@ -1,12 +1,6 @@
from __future__ import annotations
import sys
from typing import TYPE_CHECKING, Sequence
if sys.version_info >= (3, 8):
from typing import TypedDict
else:
from typing_extensions import TypedDict
from typing import TYPE_CHECKING, Sequence, TypedDict
if TYPE_CHECKING:
import datetime

View File

@@ -19,11 +19,11 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
@@ -31,7 +31,7 @@ classifiers = [
"Topic :: Text Processing",
]
dynamic = ["version"]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"click >=7.0",
"Jinja2 >=2.11.1",
@@ -42,7 +42,6 @@ dependencies = [
"ghp-import >=1.0",
"pyyaml_env_tag >=0.1",
"importlib-metadata >=4.3; python_version < '3.10'",
"typing-extensions >=3.10; python_version < '3.8'",
"packaging >=20.5",
"mergedeep >=1.3.4",
"pathspec >=0.11.1",
@@ -64,7 +63,6 @@ min-versions = [
"ghp-import ==1.0",
"pyyaml_env_tag ==0.1",
"importlib-metadata ==4.3; python_version < '3.10'",
"typing-extensions ==3.10; python_version < '3.8'",
"packaging ==20.5",
"mergedeep ==1.3.4",
"pathspec ==0.11.1",
@@ -127,7 +125,7 @@ _coverage = [
]
with-coverage = "test"
[[tool.hatch.envs.test.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"]
type = ["default", "min-req"]
[tool.hatch.envs.test.overrides]
matrix.type.features = [
@@ -142,7 +140,7 @@ template = "docs"
[tool.hatch.envs.integration.scripts]
test = "python -m mkdocs.tests.integration"
[[tool.hatch.envs.integration.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"]
type = ["default", "no-babel"]
[tool.hatch.envs.integration.overrides]
matrix.type.features = [
@@ -212,7 +210,6 @@ dependencies = [
[tool.black]
line-length = 100
target-version = ["py37"] # 3.7
skip-string-normalization = true
[tool.isort]