Skip to content

Commit

Permalink
Merge pull request #757 from thaiphv/master
Browse files Browse the repository at this point in the history
Conditionally import `ParamSpec` from `typing_extensions`
  • Loading branch information
vgrem committed Oct 16, 2023
2 parents c669742 + bf63dc0 commit 4d2e614
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion office365/runtime/client_object.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
from __future__ import annotations

import datetime
import sys
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
List,
Optional,
ParamSpec,
TypeVar,
)
if sys.version_info < (3, 10):
from typing_extensions import ParamSpec
else:
from typing import ParamSpec

from typing_extensions import Self

Expand Down
7 changes: 6 additions & 1 deletion office365/runtime/types/event_handler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import types
from typing import Callable, Iterator, TypeVar
import sys
from typing_extensions import Self
if sys.version_info < (3, 10):
from typing_extensions import ParamSpec
else:
from typing import ParamSpec

from typing_extensions import ParamSpec, Self

P = ParamSpec("P")
F = TypeVar("F", bound=Callable[..., None])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/vgrem/Office365-REST-Python-Client",
install_requires=["requests", "msal", "pytz"],
install_requires=["requests", "msal", "pytz", "typing_extensions;python_version<'3.11'"],
extras_require={"NtlmProvider": ["requests_ntlm"]},
tests_require=["pytest", "adal"],
test_suite="tests",
Expand Down

0 comments on commit 4d2e614

Please sign in to comment.