Skip to content
Open
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
10 changes: 10 additions & 0 deletions scripts/check_async_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

found_issues = False

# Methods where the async docstring is intentionally different from the sync one
# (e.g. because they accept different parameter types).
SKIPPED_METHODS = {
'with_custom_client',
}

# Get the directory of the source files
clients_path = Path(__file__).parent.resolve() / '../src/apify_client'

Expand All @@ -37,6 +43,10 @@
if len(async_method.decorators) and str(async_method.decorators[0].value) == 'ignore_docs':
continue

# Skip methods whose docstrings are intentionally different
if async_method.name in SKIPPED_METHODS:
continue

# If the sync method has a docstring, check if it matches the async dostring
if sync_method and isinstance(sync_method.value[0].value, str):
sync_docstring = sync_method.value[0].value
Expand Down
10 changes: 10 additions & 0 deletions scripts/fix_async_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
from redbaron import RedBaron
from utils import sync_to_async_docstring

# Methods where the async docstring is intentionally different from the sync one
# (e.g. because they accept different parameter types).
SKIPPED_METHODS = {
'with_custom_client',
}

# Get the directory of the source files
clients_path = Path(__file__).parent.resolve() / '../src/apify_client'

Expand Down Expand Up @@ -34,6 +40,10 @@
if len(async_method.decorators) and str(async_method.decorators[0].value) == 'ignore_docs':
continue

# Skip methods whose docstrings are intentionally different
if async_method.name in SKIPPED_METHODS:
continue

# Skip methods that don't exist in the sync class
if sync_method is None:
continue
Expand Down
18 changes: 17 additions & 1 deletion src/apify_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
from importlib import metadata

from ._apify_client import ApifyClient, ApifyClientAsync
from ._http_clients import (
HttpClient,
HttpClientAsync,
HttpResponse,
ImpitHttpClient,
ImpitHttpClientAsync,
)

__version__ = metadata.version('apify-client')

__all__ = ['ApifyClient', 'ApifyClientAsync', '__version__']
__all__ = [
'ApifyClient',
'ApifyClientAsync',
'HttpClient',
'HttpClientAsync',
'HttpResponse',
'ImpitHttpClient',
'ImpitHttpClientAsync',
'__version__',
]
Loading