Skip to content

Commit

Permalink
Drop support for Python 3.7
Browse files Browse the repository at this point in the history
This enables the use of newer Python typing functionality without
compatibility shims.
  • Loading branch information
pradyunsg committed Apr 7, 2023
1 parent 88906ab commit 69ed8b1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [Ubuntu, macOS, Windows]

steps:
Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
v1.1
----

No changes.
- Drop support for Python 3.7.

v1.0
----
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nox.options.reuse_existing_virtualenvs = True


@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"])
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "pypy3"])
def test(session: nox.Session) -> None:
session.install("-r", "dev-requirements.txt")
session.install(".")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
{name = "Thomas Kluyver", email = "thomas@kluyver.me.uk"},
]
readme = "README.rst"
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = []
classifiers = [
"License :: OSI Approved :: MIT License",
Expand Down
28 changes: 13 additions & 15 deletions src/pyproject_hooks/_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,10 @@
from os.path import abspath
from os.path import join as pjoin
from subprocess import STDOUT, check_call, check_output
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional
from typing import Any, Dict, Iterator, List, Optional, Protocol

from ._in_process import _in_proc_script_path

if TYPE_CHECKING:
from typing import Protocol

class SubprocessRunner(Protocol):
"""A protocol for the subprocess runner."""

def __call__(
self,
cmd: List[str],
cwd: Optional[str] = None,
extra_environ: Optional[Dict[str, str]] = None,
) -> None:
...


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


class SubprocessRunner(Protocol):
"""A protocol for the subprocess runner."""

def __call__(
self,
cmd: List[str],
cwd: Optional[str] = None,
extra_environ: Optional[Dict[str, str]] = None,
) -> None:
...


def default_subprocess_runner(
cmd: List[str],
cwd: Optional[str] = None,
Expand Down

0 comments on commit 69ed8b1

Please sign in to comment.