diff --git a/.coveragerc b/.coveragerc index 5b7fdefd2a..50d4bad837 100644 --- a/.coveragerc +++ b/.coveragerc @@ -20,3 +20,6 @@ exclude_also = # jaraco/skeleton#97 @overload if TYPE_CHECKING: + # Coverage is only run on the latest Python version + # these will never be considered covered and we aim for 100% coverage + if sys\.version_info < diff --git a/setuptools/_path.py b/setuptools/_path.py index fb8ef0e198..100dde5719 100644 --- a/setuptools/_path.py +++ b/setuptools/_path.py @@ -2,10 +2,10 @@ import sys from typing import Union -if sys.version_info >= (3, 9): - StrPath = Union[str, os.PathLike[str]] # Same as _typeshed.StrPath -else: +if sys.version_info < (3, 9): StrPath = Union[str, os.PathLike] +else: + StrPath = Union[str, os.PathLike[str]] # Same as _typeshed.StrPath def ensure_directory(path): diff --git a/setuptools/compat/py310.py b/setuptools/compat/py310.py index f7d53d6de9..b775961570 100644 --- a/setuptools/compat/py310.py +++ b/setuptools/compat/py310.py @@ -4,7 +4,7 @@ __all__ = ['tomllib'] -if sys.version_info >= (3, 11): - import tomllib -else: # pragma: no cover +if sys.version_info < (3, 11): from setuptools.extern import tomli as tomllib +else: + import tomllib