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

Conditionally import ParamSpec from typing_extensions #757

Merged
merged 2 commits into from
Oct 16, 2023
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
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