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

Feature: remove pytz usage due to updated O365 lib release #58

Merged
merged 1 commit into from
Oct 7, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import List, Optional, Dict, Any, Tuple

import marshmallow_dataclass
import pytz
import typer
from O365 import Account
from O365.calendar import Schedule, Calendar, Event
Expand Down Expand Up @@ -61,11 +60,8 @@ def authenticate(self) -> Optional[Dict[str, Any]]:
def check_connection_and_credentials(self):
if not self._outlook_configuration:
raise ValueError("Cannot check connection, Outlook configuration is missing")
# Note: we set the "timezone=pytz.UTC" argument only to avoid PytzUsageWarning that point to
# https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
# The issue is known (https://github.com/O365/python-o365/issues/753) but unlikely to be fixed soon
self._account = Account(str(self._outlook_configuration.client_id), auth_flow_type="public",
token_backend=self._backend, timezone=pytz.UTC,
token_backend=self._backend,
tenant_id=self._outlook_configuration.tenant_id or OUTLOOK365_OAUTH_COMMON_TENANT)
if not self._account.is_authenticated:
raise RuntimeError("Unable to load auth token")
Expand Down