Skip to content

Commit 8e4e4cd

Browse files
kinuaxsvlandegpre-commit-ci[bot]
authored
🔥 Drop support for Python 3.7 (#830)
Co-authored-by: svlandeg <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sofie Van Landeghem <[email protected]>
1 parent 7afa636 commit 8e4e4cd

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
2222
os: [ ubuntu-latest, windows-latest, macos-latest ]
2323
python-version: [ "3.13" ]
2424
include:
25-
- os: ubuntu-22.04
26-
python-version: "3.7"
2725
- os: macos-latest
2826
python-version: "3.8"
2927
- os: windows-latest

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "Typer, build great CLIs. Easy to code. Based on Python type hints
99
authors = [
1010
{name = "Sebastián Ramírez", email = "[email protected]"},
1111
]
12-
requires-python = ">=3.7"
12+
requires-python = ">=3.8"
1313
classifiers = [
1414
"Intended Audience :: Information Technology",
1515
"Intended Audience :: System Administrators",
@@ -24,7 +24,6 @@ classifiers = [
2424
"Development Status :: 4 - Beta",
2525
"Intended Audience :: Developers",
2626
"Programming Language :: Python :: 3 :: Only",
27-
"Programming Language :: Python :: 3.7",
2827
"Programming Language :: Python :: 3.8",
2928
"Programming Language :: Python :: 3.9",
3029
"Programming Language :: Python :: 3.10",

typer/_typing.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copied from pydantic 1.9.2 (the latest version to support python 3.6.)
22
# https://github.com/pydantic/pydantic/blob/v1.9.2/pydantic/typing.py
3-
# Reduced drastically to only include Typer-specific 3.7+ functionality
3+
# Reduced drastically to only include Typer-specific 3.8+ functionality
44
# mypy: ignore-errors
55

66
import sys
@@ -57,17 +57,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool:
5757
NONE_TYPES: Tuple[Any, Any, Any] = (None, NoneType, Literal[None])
5858

5959

60-
if sys.version_info < (3, 8):
61-
# Even though this implementation is slower, we need it for python 3.7:
62-
# In python 3.7 "Literal" is not a builtin type and uses a different
63-
# mechanism.
64-
# for this reason `Literal[None] is Literal[None]` evaluates to `False`,
65-
# breaking the faster implementation used for the other python versions.
66-
67-
def is_none_type(type_: Any) -> bool:
68-
return type_ in NONE_TYPES
69-
70-
elif sys.version_info[:2] == (3, 8):
60+
if sys.version_info[:2] == (3, 8):
7161
# We can use the fast implementation for 3.8 but there is a very weird bug
7262
# where it can fail for `Literal[None]`.
7363
# We just need to redefine a useless `Literal[None]` inside the function body to fix this

0 commit comments

Comments
 (0)