Skip to content
Myr

🔥 Drop support for Python 3.7 (#830)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kinuax · committed by GitHub · parent 7afa636 · Browse files · 3 files+3 added−16 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: svlandeg <svlandeg@github.com>
  • Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

Diff stats

3 files+3 added−16 removed

  • other:+3 added−16 removed

3 files+3 added−16 removed

modified:.github/workflows/test.yml-2 removed
modified:typer/_typing.py+2 added-12 removed
1# Copied from pydantic 1.9.2 (the latest version to support python 3.6.)2# https://github.com/pydantic/pydantic/blob/v1.9.2/pydantic/typing.py3# Reduced drastically to only include Typer-specific 3.7+ functionality3# Reduced drastically to only include Typer-specific 3.8+ functionality4# mypy: ignore-errors56import sys7from typing import (
48 unmodified lines
5657NONE_TYPES: Tuple[Any, Any, Any] = (None, NoneType, Literal[None])585960if 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 different63 # mechanism.64 # for this reason `Literal[None] is Literal[None]` evaluates to `False`,65 # breaking the faster implementation used for the other python versions.6667 def is_none_type(type_: Any) -> bool:68 return type_ in NONE_TYPES6970elif sys.version_info[:2] == (3, 8):60if sys.version_info[:2] == (3, 8):61 # We can use the fast implementation for 3.8 but there is a very weird bug62 # where it can fail for `Literal[None]`.63 # We just need to redefine a useless `Literal[None]` inside the function body to fix this64
41 unmodified lines
modified:pyproject.toml+1 added-2 removed
7 unmodified lines
8description = "Typer, build great CLIs. Easy to code. Based on Python type hints."9authors = [10 {name = "Sebastián Ramírez", email = "tiangolo@gmail.com"},11]12requires-python = ">=3.7"12requires-python = ">=3.8"13classifiers = [14 "Intended Audience :: Information Technology",15 "Intended Audience :: System Administrators",16 "Operating System :: OS Independent",
6 unmodified lines
23 "Typing :: Typed",24 "Development Status :: 4 - Beta",25 "Intended Audience :: Developers",26 "Programming Language :: Python :: 3 :: Only",27 "Programming Language :: Python :: 3.7",27 "Programming Language :: Python :: 3.8",28 "Programming Language :: Python :: 3.9",29 "Programming Language :: Python :: 3.10",30 "Programming Language :: Python :: 3.11",
185 unmodified lines