Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove typing_extensions runtime dep on >= py3.8 #850

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires = [
"packaging>=20",
"setuptools>=55",
'tomli; python_version < "3.11"',
"typing_extensions",
'typing_extensions; python_version < "3.8"',
]

[project]
Expand Down Expand Up @@ -45,7 +45,7 @@ dependencies = [
"packaging>=20",
"setuptools",
'tomli>=1; python_version < "3.11"',
"typing-extensions",
'typing-extensions; python_version < "3.11"',
]
[project.optional-dependencies]
rich = [
Expand Down
6 changes: 5 additions & 1 deletion src/setuptools_scm/_entrypoints.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
from __future__ import annotations

import sys
from typing import Any
from typing import Callable
from typing import cast
from typing import Iterator
from typing import overload
from typing import TYPE_CHECKING

from typing_extensions import Protocol
if sys.version_info[:2] >= (3, 8):
from typing import Protocol
else:
from typing_extensions import Protocol

from . import _log
from . import version
Expand Down
7 changes: 5 additions & 2 deletions src/setuptools_scm/_file_finders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
import itertools
import os
from typing import Callable

from typing_extensions import TypeGuard
from typing import TYPE_CHECKING

from .. import _log
from .. import _types as _t
from .._entrypoints import iter_entry_points

if TYPE_CHECKING:
from typing_extensions import TypeGuard


log = _log.log.getChild("file_finder")


Expand Down
6 changes: 4 additions & 2 deletions src/setuptools_scm/_integration/pyproject_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
from typing import Callable
from typing import Dict
from typing import NamedTuple

from typing_extensions import TypeAlias
from typing import TYPE_CHECKING

from .setuptools import read_dist_name_from_setup_cfg

if TYPE_CHECKING:
from typing_extensions import TypeAlias

_ROOT = "root"
TOML_RESULT: TypeAlias = Dict[str, Any]
TOML_LOADER: TypeAlias = Callable[[str], TOML_RESULT]
Expand Down
2 changes: 1 addition & 1 deletion src/setuptools_scm/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from typing import TYPE_CHECKING
from typing import Union

from typing_extensions import TypeAlias

if TYPE_CHECKING:
from typing_extensions import TypeAlias
from . import version

PathT: TypeAlias = Union["os.PathLike[str]", str]
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ deps=
pytest
setuptools >= 45
virtualenv>20
typing_extensions
commands=
pytest []

Expand All @@ -39,7 +38,7 @@ deps=
check-manifest
docutils
pygments
typing_extensions
typing_extensions; python_version<'3.8'
hatchling
commands=
rst2html.py README.rst {envlogdir}/README.html --strict []
Expand Down