Skip to content

Commit 3ac1b7f

Browse files
committed
Drop support for Python 3.9
1 parent 2298918 commit 3ac1b7f

File tree

12 files changed

+27
-51
lines changed

12 files changed

+27
-51
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,8 @@ jobs:
3434
- python: '3.11'
3535
os: macos-latest
3636
- python: '3.10'
37-
os: ubuntu-latest
38-
- python: '3.10'
39-
os: macos-latest
40-
- python: '3.9'
4137
os: windows-latest
42-
- python: '3.9'
38+
- python: '3.10'
4339
os: ubuntu-latest
4440
versions: minimal
4541
runs-on: ${{matrix.os}}

properdocs/config/config_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
import types
1111
import warnings
1212
from collections import Counter, UserString
13-
from collections.abc import Collection, Iterator, Mapping, MutableMapping
13+
from collections.abc import Callable, Collection, Iterator, Mapping, MutableMapping
1414
from types import SimpleNamespace
15-
from typing import Any, Callable, Generic, NamedTuple, TypeVar, Union, overload
15+
from typing import Any, Generic, NamedTuple, TypeVar, Union, overload
1616
from urllib.parse import quote as urlquote
1717
from urllib.parse import urlsplit, urlunsplit
1818

properdocs/livereload/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import webbrowser
2222
import wsgiref.simple_server
2323
import wsgiref.util
24-
from collections.abc import Iterable
25-
from typing import Any, BinaryIO, Callable
24+
from collections.abc import Callable, Iterable
25+
from typing import Any, BinaryIO
2626

2727
import watchdog.events
2828
import watchdog.observers.polling

properdocs/plugins.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
from __future__ import annotations
44

55
import logging
6-
import sys
7-
from collections.abc import MutableMapping
8-
from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, TypeVar, overload
9-
10-
if sys.version_info >= (3, 10):
11-
from importlib.metadata import EntryPoint, entry_points
12-
else:
13-
from importlib_metadata import EntryPoint, entry_points
6+
from collections.abc import Callable, MutableMapping
7+
from importlib.metadata import EntryPoint, entry_points
8+
from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar, overload
149

1510
if TYPE_CHECKING:
1611
import jinja2.environment
@@ -33,7 +28,9 @@
3328
from properdocs.utils.templates import TemplateContext
3429

3530
if TYPE_CHECKING:
36-
from typing_extensions import Concatenate, ParamSpec
31+
from typing import Concatenate
32+
33+
from typing_extensions import ParamSpec
3734
else:
3835
ParamSpec = TypeVar
3936

properdocs/structure/files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
import posixpath
88
import shutil
99
import warnings
10-
from collections.abc import Iterable, Iterator, Mapping, Sequence
10+
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
1111
from functools import cached_property
1212
from pathlib import PurePath, PurePosixPath
13-
from typing import TYPE_CHECKING, Callable, overload
13+
from typing import TYPE_CHECKING, overload
1414
from urllib.parse import quote as urlquote
1515

1616
import pathspec

properdocs/structure/pages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import logging
55
import posixpath
66
import warnings
7-
from collections.abc import Iterator, MutableMapping, Sequence
8-
from typing import TYPE_CHECKING, Any, Callable
7+
from collections.abc import Callable, Iterator, MutableMapping, Sequence
8+
from typing import TYPE_CHECKING, Any
99
from urllib.parse import unquote as urlunquote
1010
from urllib.parse import urljoin, urlsplit, urlunsplit
1111

properdocs/tests/structure/file_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import itertools
12
import os
23
import sys
34
import unittest
@@ -64,7 +65,7 @@ def test_file_sort_key(self):
6465
]:
6566
with self.subTest(case):
6667
files = [File(f, "", "", use_directory_urls=True) for f in case]
67-
for a, b in zip(files, files[1:]):
68+
for a, b in itertools.pairwise(files):
6869
self.assertLess(file_sort_key(a), file_sort_key(b))
6970

7071
def test_md_file(self):

properdocs/tests/structure/page_tests.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,9 @@ def get_rendered_result(
784784
pg.render(cfg, Files(fs))
785785
msgs = [f'{r.levelname}:{r.message}' for r in cm.records]
786786
self.assertEqual('\n'.join(msgs), textwrap.dedent(logs).strip('\n'))
787-
elif sys.version_info >= (3, 10):
787+
else:
788788
with self.assertNoLogs('properdocs.structure.pages'):
789789
pg.render(cfg, Files(fs))
790-
else:
791-
pg.render(cfg, Files(fs))
792790

793791
assert pg.content is not None
794792
content = pg.content

properdocs/utils/__init__.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@
1313
import posixpath
1414
import re
1515
import shutil
16-
import sys
1716
import warnings
17+
from bisect import insort # noqa: F401 - legacy re-export
1818
from collections import defaultdict
19-
from collections.abc import Collection, Iterable, MutableSequence
19+
from collections.abc import Collection, Iterable
2020
from datetime import datetime, timezone
21+
from importlib.metadata import EntryPoint, entry_points
2122
from pathlib import PurePath
2223
from typing import TYPE_CHECKING, TypeVar
2324
from urllib.parse import urlsplit
2425

25-
if sys.version_info >= (3, 10):
26-
from importlib.metadata import EntryPoint, entry_points
27-
else:
28-
from importlib_metadata import EntryPoint, entry_points
29-
3026
from properdocs import exceptions
3127
from properdocs.utils.yaml import get_yaml_loader, yaml_load # noqa: F401 - legacy re-export
3228

@@ -93,18 +89,6 @@ def reduce_list(data_set: Iterable[T]) -> list[T]:
9389
return list(dict.fromkeys(data_set))
9490

9591

96-
if sys.version_info >= (3, 10):
97-
from bisect import insort
98-
else:
99-
100-
def insort(a: MutableSequence[T], x: T, *, key=lambda v: v) -> None:
101-
kx = key(x)
102-
i = len(a)
103-
while i > 0 and kx < key(a[i - 1]):
104-
i -= 1
105-
a.insert(i, x)
106-
107-
10892
def copy_file(source_path: str, output_path: str) -> None:
10993
"""
11094
Copy source_path to output_path, making sure any parent directories exist.

properdocs/utils/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import datetime
22
import urllib.request
3-
from typing import Callable
3+
from collections.abc import Callable
44

55
import mkdocs_get_deps.cache
66

0 commit comments

Comments
 (0)