Skip to content

Commit

Permalink
fixed _API_TIMEOUT circular import error
Browse files Browse the repository at this point in the history
  • Loading branch information
nh916 committed Aug 30, 2023
1 parent 1511770 commit acb19ac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/cript/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
from cript.api.api import API
from cript.api.valid_search_modes import SearchModes
from cript.api.vocabulary_categories import VocabCategories

# Default maximum seconds for all requests to the backend
_API_TIMEOUT = 25
2 changes: 1 addition & 1 deletion src/cript/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import requests
from beartype import beartype

from cript.api import _API_TIMEOUT
from cript.api.api_config import _API_TIMEOUT
from cript.api.exceptions import (
CRIPTAPIRequiredError,
CRIPTAPISaveError,
Expand Down
9 changes: 9 additions & 0 deletions src/cript/api/api_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""

Check failure on line 1 in src/cript/api/api_config.py

View workflow job for this annotation

GitHub Actions / Trunk Check

black

Incorrect formatting, autoformat by running 'trunk fmt'
# API Configuration Constants
This module contains configuration constants for the API client.
These constants are used to customize various aspects of the API requests and behavior.
"""

# Default maximum time in seconds for all API requests to wait for a response from the backend
_API_TIMEOUT = 25
2 changes: 1 addition & 1 deletion src/cript/api/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests
from beartype import beartype

from cript.api import _API_TIMEOUT
from cript.api.api_config import _API_TIMEOUT


class Paginator:
Expand Down
2 changes: 1 addition & 1 deletion src/cript/api/utils/web_file_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import requests

from cript.api import _API_TIMEOUT
from cript.api.api_config import _API_TIMEOUT


def download_file_from_url(url: str, destination_path: Union[str, Path]) -> None:
Expand Down

0 comments on commit acb19ac

Please sign in to comment.