Skip to content

Commit

Permalink
only use typing_extensions for older python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nekopsykose committed Aug 23, 2023
1 parent e09e435 commit 4a63fba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -27,7 +27,7 @@ classifiers = [
dependencies = [
"setuptools>=62.4",
"semantic_version>=2.8.2,<3",
"typing_extensions>=3.7.4.3",
'typing_extensions>=3.7.4.3; python_version<"3.9"',
'tomli>=1.2.1; python_version<"3.11"'
]

Expand Down
6 changes: 5 additions & 1 deletion setuptools_rust/build.py
Expand Up @@ -24,7 +24,11 @@
from setuptools.command.build import build as CommandBuild
from setuptools.command.build_ext import build_ext as CommandBuildExt
from setuptools.command.build_ext import get_abi3_suffix
from typing_extensions import Literal

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal

from ._utils import format_called_process_error
from .command import RustCommand
Expand Down
7 changes: 6 additions & 1 deletion setuptools_rust/extension.py
Expand Up @@ -2,14 +2,19 @@
import os
import re
import subprocess
import sys
import warnings
from setuptools.errors import SetupError
from enum import IntEnum, auto
from functools import lru_cache
from typing import Any, Dict, List, NewType, Optional, Sequence, Union, cast

from semantic_version import SimpleSpec
from typing_extensions import Literal

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal

from ._utils import format_called_process_error

Expand Down
6 changes: 5 additions & 1 deletion setuptools_rust/setuptools_ext.py
Expand Up @@ -14,7 +14,11 @@
from setuptools.command.install_scripts import install_scripts
from setuptools.command.sdist import sdist
from setuptools.dist import Distribution
from typing_extensions import Literal

if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal

from .build import _get_bdist_wheel_cmd
from .extension import Binding, RustBin, RustExtension, Strip
Expand Down

0 comments on commit 4a63fba

Please sign in to comment.