diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7823e22a8..f2f6035435 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,8 +22,6 @@ jobs: os: [ ubuntu-latest, windows-latest, macos-latest ] python-version: [ "3.13" ] include: - - os: ubuntu-22.04 - python-version: "3.7" - os: macos-latest python-version: "3.8" - os: windows-latest diff --git a/pyproject.toml b/pyproject.toml index c0ca3aa418..115c67383a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "Typer, build great CLIs. Easy to code. Based on Python type hints authors = [ {name = "Sebastián Ramírez", email = "tiangolo@gmail.com"}, ] -requires-python = ">=3.7" +requires-python = ">=3.8" classifiers = [ "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", @@ -24,7 +24,6 @@ classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/typer/_typing.py b/typer/_typing.py index c4b3f7c8dd..879fac4103 100644 --- a/typer/_typing.py +++ b/typer/_typing.py @@ -1,6 +1,6 @@ # Copied from pydantic 1.9.2 (the latest version to support python 3.6.) # https://github.com/pydantic/pydantic/blob/v1.9.2/pydantic/typing.py -# Reduced drastically to only include Typer-specific 3.7+ functionality +# Reduced drastically to only include Typer-specific 3.8+ functionality # mypy: ignore-errors import sys @@ -57,17 +57,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: NONE_TYPES: Tuple[Any, Any, Any] = (None, NoneType, Literal[None]) -if sys.version_info < (3, 8): - # Even though this implementation is slower, we need it for python 3.7: - # In python 3.7 "Literal" is not a builtin type and uses a different - # mechanism. - # for this reason `Literal[None] is Literal[None]` evaluates to `False`, - # breaking the faster implementation used for the other python versions. - - def is_none_type(type_: Any) -> bool: - return type_ in NONE_TYPES - -elif sys.version_info[:2] == (3, 8): +if sys.version_info[:2] == (3, 8): # We can use the fast implementation for 3.8 but there is a very weird bug # where it can fail for `Literal[None]`. # We just need to redefine a useless `Literal[None]` inside the function body to fix this