Skip to content

Commit f3d9e2f

Browse files
committed
Bump requires-python to Python 3.8+
This enables the use of newer Python typing functionality without compatibility shims.
1 parent 806ddcf commit f3d9e2f

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = [
88
{name = "Thomas Kluyver", email = "[email protected]"},
99
]
1010
readme = "README.rst"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8"
1212
dependencies = []
1313
classifiers = [
1414
"License :: OSI Approved :: MIT License",

src/pyproject_hooks/_impl.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,10 @@
66
from os.path import abspath
77
from os.path import join as pjoin
88
from subprocess import STDOUT, check_call, check_output
9-
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional
9+
from typing import Any, Dict, Iterator, List, Optional, Protocol
1010

1111
from ._in_process import _in_proc_script_path
1212

13-
if TYPE_CHECKING:
14-
from typing import Protocol
15-
16-
class SubprocessRunner(Protocol):
17-
"""A protocol for the subprocess runner."""
18-
19-
def __call__(
20-
self,
21-
cmd: List[str],
22-
cwd: Optional[str] = None,
23-
extra_environ: Optional[Dict[str, str]] = None,
24-
) -> None:
25-
...
26-
2713

2814
def write_json(obj: Dict[str, Any], path: str, **kwargs) -> None:
2915
with open(path, "w", encoding="utf-8") as f:
@@ -71,6 +57,18 @@ def __init__(self, traceback: str) -> None:
7157
self.traceback = traceback
7258

7359

60+
class SubprocessRunner(Protocol):
61+
"""A protocol for the subprocess runner."""
62+
63+
def __call__(
64+
self,
65+
cmd: List[str],
66+
cwd: Optional[str] = None,
67+
extra_environ: Optional[Dict[str, str]] = None,
68+
) -> None:
69+
...
70+
71+
7472
def default_subprocess_runner(
7573
cmd: List[str],
7674
cwd: Optional[str] = None,

0 commit comments

Comments
 (0)