diff --git a/pyproject.toml b/pyproject.toml index 62acd7d5cb..57eb95ef76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ ] dependencies = [ "click >= 8.0.0", - "typing-extensions >= 3.7.4.3", + "typing-extensions >= 3.7.4.3; python_version < '3.9'", ] readme = "README.md" [project.urls] diff --git a/tests/assets/cli/rich_formatted_app.py b/tests/assets/cli/rich_formatted_app.py index 54d8a52267..b6a01cd5c8 100644 --- a/tests/assets/cli/rich_formatted_app.py +++ b/tests/assets/cli/rich_formatted_app.py @@ -1,5 +1,5 @@ import typer -from typing_extensions import Annotated +from typer._typing import Annotated app = typer.Typer(rich_markup_mode="rich") diff --git a/tests/test_ambiguous_params.py b/tests/test_ambiguous_params.py index 0693c8e9aa..3fd1caceb2 100644 --- a/tests/test_ambiguous_params.py +++ b/tests/test_ambiguous_params.py @@ -1,5 +1,6 @@ import pytest import typer +from typer._typing import Annotated from typer.testing import CliRunner from typer.utils import ( AnnotatedParamWithDefaultValueError, @@ -8,7 +9,6 @@ MultipleTyperAnnotationsError, _split_annotation_from_typer_annotations, ) -from typing_extensions import Annotated runner = CliRunner() @@ -93,7 +93,7 @@ def test_allow_multiple_non_typer_params_in_annotated(): app = typer.Typer() @app.command() - def cmd(my_param: Annotated[str, "someval", typer.Argument(), 4] = "hello"): + def cmd(my_param: Annotated[str, "someval", typer.Argument(), 4] = "hello"): # noqa:F821 print(my_param) result = runner.invoke(app) diff --git a/tests/test_annotated.py b/tests/test_annotated.py index c1be5b88d7..f6f35c5b44 100644 --- a/tests/test_annotated.py +++ b/tests/test_annotated.py @@ -2,8 +2,8 @@ from pathlib import Path import typer +from typer._typing import Annotated from typer.testing import CliRunner -from typing_extensions import Annotated from .utils import needs_py310 diff --git a/tests/test_future_annotations.py b/tests/test_future_annotations.py index e820cd0923..443415636a 100644 --- a/tests/test_future_annotations.py +++ b/tests/test_future_annotations.py @@ -1,8 +1,8 @@ from __future__ import annotations import typer +from typer._typing import Annotated from typer.testing import CliRunner -from typing_extensions import Annotated runner = CliRunner()