Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEP: Ensure typing_extension is dependency for earlier python versions #290

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dev = [
"pydantic",
"pydantic-settings",
"smbprotocol",
"typing_extensions; python_version<'3.11'",
]

[project.urls]
Expand Down
10 changes: 5 additions & 5 deletions upath/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
from typing import overload
from urllib.parse import urlsplit

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

from fsspec.registry import get_filesystem_class
from fsspec.spec import AbstractFileSystem

Expand All @@ -43,6 +38,11 @@
if TYPE_CHECKING:
from urllib.parse import SplitResult

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

__all__ = ["UPath"]


Expand Down
10 changes: 6 additions & 4 deletions upath/implementations/sftp.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from __future__ import annotations

import sys
from typing import TYPE_CHECKING
from typing import Any
from typing import Generator

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self
if TYPE_CHECKING:
if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

from upath import UPath

Expand Down
10 changes: 6 additions & 4 deletions upath/implementations/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import os
import sys
import warnings
from typing import TYPE_CHECKING
from typing import Any

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self
if TYPE_CHECKING:
if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

import smbprotocol.exceptions

Expand Down