Skip to content

Commit

Permalink
fix: compatibility with python3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Jan 10, 2023
1 parent 00670f6 commit 064e1df
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions invenio_campusonline/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# file for more details.

"""API functions of the campusonline connector."""
from typing import Callable
from typing import Callable, List, Tuple
from xml.etree.ElementTree import fromstring

from requests import post
Expand Down Expand Up @@ -37,7 +37,7 @@ def import_from_campusonline(

def fetch_all_ids(
endpoint: URL, token: CampusOnlineToken, theses_filters: ThesesFilter = None
) -> list[tuple[CampusOnlineID, ThesesState]]:
) -> List[Tuple[CampusOnlineID, ThesesState]]:
"""Fetch to import ids."""
ids = []
for theses_filter, state in theses_filters:
Expand Down
4 changes: 2 additions & 2 deletions invenio_campusonline/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


"""Celery tasks for `invenio-campusonline`."""
from typing import Callable
from typing import Callable, Tuple

from celery import shared_task
from flask import current_app
Expand All @@ -18,7 +18,7 @@
from .types import CampusOnlineConfigs


def config_variables() -> tuple[Callable, CampusOnlineConfigs]:
def config_variables() -> Tuple[Callable, CampusOnlineConfigs]:
"""Configuration variables."""
import_func = current_app.config["CAMPUSONLINE_IMPORT_FUNC"]
endpoint = current_app.config["CAMPUSONLINE_ENDPOINT"]
Expand Down
5 changes: 3 additions & 2 deletions invenio_campusonline/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from dataclasses import astuple, dataclass
from enum import Enum
from typing import List
from xml.etree.ElementTree import Element

URL = str
Expand Down Expand Up @@ -49,7 +50,7 @@ class ThesesState(Enum):
class ThesesFilter:
"""Filter dataclass."""

filter_: list[Element]
filter_: List[Element]
state: ThesesState

def __iter__(self):
Expand All @@ -65,5 +66,5 @@ class CampusOnlineConfigs:
token: CampusOnlineToken
user_email: EmailAddress
theses_filters: ThesesFilter
recipients: list[EmailAddress]
recipients: List[EmailAddress]
sender: EmailAddress
4 changes: 2 additions & 2 deletions invenio_campusonline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# file for more details.

"""Command line interface to interact with the CampusOnline-Connector module."""

from shutil import copyfileobj
from typing import List
from xml.etree.ElementTree import Element, fromstring

from requests import get, post
Expand Down Expand Up @@ -71,7 +71,7 @@ def create_request_body_download(


def create_request_body_ids(
token: CampusOnlineToken, theses_filter: list[Element]
token: CampusOnlineToken, theses_filter: List[Element]
) -> str:
"""Build request."""
body = """
Expand Down

0 comments on commit 064e1df

Please sign in to comment.