From d4cedefff313813bbc72d2ce9e9a4b175b338a17 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 18 Mar 2024 16:18:02 +0200 Subject: [PATCH] Drop typing-extensions dependency as unnecessary --- fluent.docs/setup.py | 1 - fluent.runtime/fluent/runtime/bundle.py | 3 +-- fluent.runtime/fluent/runtime/types.py | 3 +-- fluent.runtime/setup.py | 1 - fluent.runtime/tests/test_types.py | 7 ++++++- fluent.runtime/tox.ini | 1 - fluent.syntax/fluent/syntax/stream.py | 4 +--- fluent.syntax/setup.py | 1 - fluent.syntax/tox.ini | 2 -- 9 files changed, 9 insertions(+), 14 deletions(-) diff --git a/fluent.docs/setup.py b/fluent.docs/setup.py index 9e270568..b0747ecc 100644 --- a/fluent.docs/setup.py +++ b/fluent.docs/setup.py @@ -3,5 +3,4 @@ setup( name="fluent.docs", packages=["fluent.docs"], - install_requires=["typing-extensions>=3.7,<5"], ) diff --git a/fluent.runtime/fluent/runtime/bundle.py b/fluent.runtime/fluent/runtime/bundle.py index c49006a2..d9e53807 100644 --- a/fluent.runtime/fluent/runtime/bundle.py +++ b/fluent.runtime/fluent/runtime/bundle.py @@ -1,10 +1,9 @@ -from typing import TYPE_CHECKING, Any, Callable, Union, cast +from typing import TYPE_CHECKING, Any, Callable, Literal, Union, cast import babel import babel.numbers import babel.plural from fluent.syntax import ast as FTL -from typing_extensions import Literal from .builtins import BUILTINS from .prepare import Compiler diff --git a/fluent.runtime/fluent/runtime/types.py b/fluent.runtime/fluent/runtime/types.py index 318641ee..c6717194 100644 --- a/fluent.runtime/fluent/runtime/types.py +++ b/fluent.runtime/fluent/runtime/types.py @@ -1,14 +1,13 @@ import warnings from datetime import date, datetime from decimal import Decimal -from typing import Any, TypeVar, Union, cast +from typing import Any, Literal, TypeVar, Union, cast import attr import pytz from babel import Locale from babel.dates import format_date, format_time, get_datetime_format, get_timezone from babel.numbers import NumberPattern, parse_pattern -from typing_extensions import Literal FORMAT_STYLE_DECIMAL = "decimal" FORMAT_STYLE_CURRENCY = "currency" diff --git a/fluent.runtime/setup.py b/fluent.runtime/setup.py index 03d3ae68..c66b513a 100755 --- a/fluent.runtime/setup.py +++ b/fluent.runtime/setup.py @@ -35,7 +35,6 @@ "attrs", "babel", "pytz", - "typing-extensions>=3.7,<5", ], test_suite="tests", ) diff --git a/fluent.runtime/tests/test_types.py b/fluent.runtime/tests/test_types.py index 72e1d267..788c97cd 100644 --- a/fluent.runtime/tests/test_types.py +++ b/fluent.runtime/tests/test_types.py @@ -5,7 +5,12 @@ import pytz from babel import Locale -from fluent.runtime.types import FluentDateType, FluentNumber, fluent_date, fluent_number +from fluent.runtime.types import ( + FluentDateType, + FluentNumber, + fluent_date, + fluent_number, +) class TestFluentNumber(unittest.TestCase): diff --git a/fluent.runtime/tox.ini b/fluent.runtime/tox.ini index 3951bc48..ed254d68 100644 --- a/fluent.runtime/tox.ini +++ b/fluent.runtime/tox.ini @@ -12,7 +12,6 @@ deps = attrs==19.1.0 babel==2.7.0 pytz==2019.2 - typing-extensions~=3.7 syntax: . commands = python -m unittest diff --git a/fluent.syntax/fluent/syntax/stream.py b/fluent.syntax/fluent/syntax/stream.py index 0e276fc3..2a485e22 100644 --- a/fluent.syntax/fluent/syntax/stream.py +++ b/fluent.syntax/fluent/syntax/stream.py @@ -1,6 +1,4 @@ -from typing import Callable, Union - -from typing_extensions import Literal +from typing import Callable, Literal, Union from .errors import ParseError diff --git a/fluent.syntax/setup.py b/fluent.syntax/setup.py index d93a796d..3fb4cade 100644 --- a/fluent.syntax/setup.py +++ b/fluent.syntax/setup.py @@ -29,6 +29,5 @@ packages=["fluent.syntax"], package_data={"fluent.syntax": ["py.typed"]}, python_requires=">=3.9", - install_requires=["typing-extensions>=3.7,<5"], test_suite="tests.syntax", ) diff --git a/fluent.syntax/tox.ini b/fluent.syntax/tox.ini index 5e24d44a..04b57ad6 100644 --- a/fluent.syntax/tox.ini +++ b/fluent.syntax/tox.ini @@ -7,6 +7,4 @@ skipsdist=True [testenv] setenv = PYTHONPATH = {toxinidir} -deps = - typing-extensions~=3.7 commands = python -m unittest