Skip to content

Commit 9338ca0

Browse files
authored
Drop support for Python 3.9 (#19)
1 parent 762c44c commit 9338ca0

File tree

14 files changed

+29
-58
lines changed

14 files changed

+29
-58
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ jobs:
3535
- python: '3.11'
3636
os: macos-latest
3737
- python: '3.10'
38-
os: ubuntu-latest
39-
- python: '3.10'
40-
os: macos-latest
41-
- python: '3.9'
4238
os: windows-latest
43-
- python: '3.9'
39+
- python: '3.10'
4440
os: ubuntu-latest
4541
versions: minimal
4642
runs-on: ${{matrix.os}}

properdocs/commands/get_deps.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import io
99
import logging
1010
import os
11-
import sys
1211
import urllib.parse
1312
from collections.abc import Collection, Mapping, Sequence
1413
from typing import IO, Any, BinaryIO
@@ -107,10 +106,7 @@ def _strings(obj) -> Sequence[str]:
107106

108107
@functools.cache
109108
def _entry_points(group: str) -> Mapping[str, Any]:
110-
if sys.version_info >= (3, 10):
111-
from importlib.metadata import entry_points
112-
else:
113-
from importlib_metadata import entry_points
109+
from importlib.metadata import entry_points
114110

115111
eps = {ep.name: ep for ep in entry_points(group=group)}
116112
log.debug(f"Available '{group}' entry points: {sorted(eps)}")

properdocs/commands/serve.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import shutil
66
import sys
77
import tempfile
8+
from collections.abc import Callable
89
from os.path import isdir, isfile, join
9-
from typing import TYPE_CHECKING, BinaryIO, Callable
10+
from typing import TYPE_CHECKING, BinaryIO
1011
from urllib.parse import urlsplit
1112

1213
from properdocs.commands.build import build

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: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@
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, Concatenate, Generic, Literal, TypeVar, overload
149

1510
if TYPE_CHECKING:
16-
import jinja2.environment
11+
import jinja2
1712

1813
from properdocs import utils
1914
from properdocs.config.base import (
@@ -33,7 +28,7 @@
3328
from properdocs.utils.templates import TemplateContext
3429

3530
if TYPE_CHECKING:
36-
from typing_extensions import Concatenate, ParamSpec
31+
from typing_extensions import ParamSpec
3732
else:
3833
ParamSpec = TypeVar
3934

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
@@ -785,11 +785,9 @@ def get_rendered_result(
785785
pg.render(cfg, Files(fs))
786786
msgs = [f'{r.levelname}:{r.message}' for r in cm.records]
787787
self.assertEqual('\n'.join(msgs), textwrap.dedent(logs).strip('\n'))
788-
elif sys.version_info >= (3, 10):
788+
else:
789789
with self.assertNoLogs('properdocs.structure.pages'):
790790
pg.render(cfg, Files(fs))
791-
else:
792-
pg.render(cfg, Files(fs))
793791

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

0 commit comments

Comments
 (0)