Skip to content

Commit

Permalink
we do not typing_extensions in 3.9+3.10 as well (dependency on Self)
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0nx committed Dec 19, 2023
1 parent 96782ba commit c6d7e57
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
5 changes: 4 additions & 1 deletion caldav/davclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@

if sys.version_info < (3, 9):
from typing import Iterable, Mapping
from typing_extensions import Self
else:
from collections.abc import Iterable, Mapping

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


Expand Down
7 changes: 4 additions & 3 deletions caldav/elements/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

if sys.version_info < (3, 9):
from typing import Iterable
from typing_extensions import Self
from typing_extensions import TypeAlias
else:
from collections.abc import Iterable

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


class BaseElement:
Expand Down
2 changes: 1 addition & 1 deletion caldav/lib/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from caldav.lib.python_utilities import to_normal_str
from caldav.lib.python_utilities import to_unicode

if sys.version_info < (3, 9):
if sys.version_info < (3, 11):
from typing_extensions import Self
else:
from typing import Self
Expand Down
5 changes: 4 additions & 1 deletion caldav/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class hierarchy into a separate file)
from typing import Iterable
from typing_extensions import DefaultDict
from typing_extensions import Literal
from typing_extensions import Self
else:
from collections.abc import Callable
from collections.abc import Container
Expand All @@ -74,6 +73,10 @@ class hierarchy into a separate file)
from collections.abc import Sequence
from collections import defaultdict as DefaultDict
from typing import Literal

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

_CC = TypeVar("_CC", bound="CalendarObjectResource")
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=64", "setuptools-scm[toml]>=8.0"]
requires = ["setuptools>=64", "setuptools-scm[toml]>=7.0"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -26,7 +26,7 @@ dependencies = [
"requests",
"icalendar",
"recurring-ical-events>=2.0.0",
"typing_extensions;python_version<'3.9'",
"typing_extensions;python_version<'3.11'",
]
dynamic = ["version"]

Expand All @@ -44,7 +44,7 @@ test = [
]

[tool.setuptools_scm]
version_file = "caldav/_version.py"
write_to = "caldav/_version.py"

[tool.setuptools]
py-modules = ["caldav"]
Expand Down

0 comments on commit c6d7e57

Please sign in to comment.