Skip to content

Commit e82098c

Browse files
authored
Relative imports are replaced with absolute imports (#176)
1 parent 7f5867d commit e82098c

39 files changed

+88
-90
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## [1.6.2](../../releases/tag/v1.6.2) - Unreleased
44

5-
...
5+
### Internal changes
6+
7+
- Relative imports were replaced for absolute imports
68

79
## [1.6.1](../../releases/tag/v1.6.1) - 2023-12-11
810

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ requires-python = ">=3.8"
2626
# compatibility with a wide range of external packages. This decision was discussed in detail in the following PR:
2727
# https://github.com/apify/apify-sdk-python/pull/154
2828
dependencies = [
29-
"apify-shared ~= 1.1.0",
29+
"apify-shared ~= 1.1.1",
3030
"httpx >= 0.25.1",
3131
]
3232

@@ -94,7 +94,6 @@ ignore = [
9494
"S303", # Use of insecure MD2, MD4, MD5, or SHA1 hash function
9595
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
9696
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...
97-
"TID252", # Relative imports from parent modules are bannedRuff
9897
"TRY003", # Avoid specifying long messages outside the exception class
9998
]
10099

@@ -126,7 +125,7 @@ docstring-quotes = "double"
126125
inline-quotes = "single"
127126

128127
[tool.ruff.lint.isort]
129-
known-first-party = ["apify", "apify_client", "apify_shared"]
128+
known-local-folder = ["apify_client"]
130129

131130
[tool.ruff.lint.pydocstyle]
132131
convention = "google"

src/apify_client/_errors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import httpx
4-
54
from apify_shared.utils import ignore_docs
65

76

src/apify_client/_http_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
from typing import TYPE_CHECKING, Any, Callable
1111

1212
import httpx
13-
1413
from apify_shared.utils import ignore_docs, is_content_type_json, is_content_type_text, is_content_type_xml
1514

16-
from ._errors import ApifyApiError, InvalidResponseBodyError, is_retryable_error
17-
from ._logging import log_context, logger_name
18-
from ._utils import retry_with_exp_backoff, retry_with_exp_backoff_async
15+
from apify_client._errors import ApifyApiError, InvalidResponseBodyError, is_retryable_error
16+
from apify_client._logging import log_context, logger_name
17+
from apify_client._utils import retry_with_exp_backoff, retry_with_exp_backoff_async
1918

2019
if TYPE_CHECKING:
2120
from apify_shared.types import JSONSerializable

src/apify_client/_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# Conditional import only executed when type checking, otherwise we'd get circular dependency issues
1111
if TYPE_CHECKING:
12-
from .clients.base.base_client import _BaseBaseClient
12+
from apify_client.clients.base.base_client import _BaseBaseClient
1313

1414
# Name of the logger used throughout the library
1515
logger_name = __name__.split('.')[0]

src/apify_client/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from apify_shared.utils import is_file_or_bytes, maybe_extract_enum_member_value
1212

1313
if TYPE_CHECKING:
14-
from ._errors import ApifyApiError
14+
from apify_client._errors import ApifyApiError
1515

1616
PARSE_DATE_FIELDS_MAX_DEPTH = 3
1717
PARSE_DATE_FIELDS_KEY_SUFFIX = 'At'

src/apify_client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from apify_shared.utils import ignore_docs
44

5-
from ._http_client import HTTPClient, HTTPClientAsync
6-
from .clients import (
5+
from apify_client._http_client import HTTPClient, HTTPClientAsync
6+
from apify_client.clients import (
77
ActorClient,
88
ActorClientAsync,
99
ActorCollectionClient,

src/apify_client/clients/base/actor_job_base_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from apify_shared.consts import ActorJobStatus
99
from apify_shared.utils import ignore_docs, parse_date_fields
1010

11-
from ..._errors import ApifyApiError
12-
from ..._utils import catch_not_found_or_throw, pluck_data
13-
from .resource_client import ResourceClient, ResourceClientAsync
11+
from apify_client._errors import ApifyApiError
12+
from apify_client._utils import catch_not_found_or_throw, pluck_data
13+
from apify_client.clients.base.resource_client import ResourceClient, ResourceClientAsync
1414

1515
DEFAULT_WAIT_FOR_FINISH_SEC = 999999
1616

src/apify_client/clients/base/base_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
from apify_shared.utils import ignore_docs
66

7-
from ..._logging import WithLogDetailsClient
8-
from ..._utils import to_safe_id
7+
from apify_client._logging import WithLogDetailsClient
8+
from apify_client._utils import to_safe_id
99

1010
# Conditional import only executed when type checking, otherwise we'd get circular dependency issues
1111
if TYPE_CHECKING:
12-
from ..._http_client import HTTPClient, HTTPClientAsync
13-
from ...client import ApifyClient, ApifyClientAsync
12+
from apify_client import ApifyClient, ApifyClientAsync
13+
from apify_client._http_client import HTTPClient, HTTPClientAsync
1414

1515

1616
class _BaseBaseClient(metaclass=WithLogDetailsClient):

src/apify_client/clients/base/resource_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from apify_shared.utils import ignore_docs, parse_date_fields
44

5-
from ..._errors import ApifyApiError
6-
from ..._utils import catch_not_found_or_throw, pluck_data
7-
from .base_client import BaseClient, BaseClientAsync
5+
from apify_client._errors import ApifyApiError
6+
from apify_client._utils import catch_not_found_or_throw, pluck_data
7+
from apify_client.clients.base.base_client import BaseClient, BaseClientAsync
88

99

1010
@ignore_docs

0 commit comments

Comments
 (0)