Skip to content
Merged
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ make run-doc
Publishing new versions to [PyPI](https://pypi.org/project/apify_client) is automated through GitHub Actions.

- **Beta releases**: On each commit to the master branch, a new beta release is automatically published. The version number is determined based on the latest release and conventional commits. The beta version suffix is incremented by 1 from the last beta release on PyPI.
- **Stable releases**: A stable version release may be created by triggering the `release` GitHub Actions workflow. The version number is determined based on the latest release and conventional commits (`auto` release type), or it may be overriden using the `custom` release type.
- **Stable releases**: A stable version release may be created by triggering the `release` GitHub Actions workflow. The version number is determined based on the latest release and conventional commits (`auto` release type), or it may be overridden using the `custom` release type.

### Publishing to PyPI manually

Expand Down
10 changes: 5 additions & 5 deletions src/apify_client/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,16 @@ def create_redirect_logger(


class RedirectLogFormatter(logging.Formatter):
"""Formater applied to default redirect logger."""
"""Formatter applied to default redirect logger."""

def format(self, record: logging.LogRecord) -> str:
"""Format the log by prepending logger name to the original message.

Args:
record: Log record to be formated.
record: Log record to be formatted.

Returns:
Formated log message.
Formatted log message.
"""
formated_logger_name = f'{Fore.CYAN}[{record.name}]{Style.RESET_ALL}'
return f'{formated_logger_name} -> {record.msg}'
formatted_logger_name = f'{Fore.CYAN}[{record.name}]{Style.RESET_ALL}'
return f'{formatted_logger_name} -> {record.msg}'
4 changes: 2 additions & 2 deletions src/apify_client/clients/resource_clients/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None:
wait_secs: How long does the client wait for build to finish. None for indefinite.

Returns:
The Actor build data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED,
The Actor build data. If the status on the object is not one of the terminal statuses (SUCCEEDED, FAILED,
TIMED_OUT, ABORTED), then the build has not yet finished.
"""
return self._wait_for_finish(wait_secs=wait_secs)
Expand Down Expand Up @@ -140,7 +140,7 @@ async def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None:
wait_secs: How long does the client wait for build to finish. None for indefinite.

Returns:
The Actor build data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED,
The Actor build data. If the status on the object is not one of the terminal statuses (SUCCEEDED, FAILED,
TIMED_OUT, ABORTED), then the build has not yet finished.
"""
return await self._wait_for_finish(wait_secs=wait_secs)
Expand Down
12 changes: 6 additions & 6 deletions src/apify_client/clients/resource_clients/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get(self, *, raw: bool = False) -> str | None:
https://docs.apify.com/api/v2#/reference/logs/log/get-log

Args:
raw: If true, the log will include formating. For example, coloring character sequences.
raw: If true, the log will include formatting. For example, coloring character sequences.

Returns:
The retrieved log, or None, if it does not exist.
Expand All @@ -63,7 +63,7 @@ def get_as_bytes(self, *, raw: bool = False) -> bytes | None:
https://docs.apify.com/api/v2#/reference/logs/log/get-log

Args:
raw: If true, the log will include formating. For example, coloring character sequences.
raw: If true, the log will include formatting. For example, coloring character sequences.

Returns:
The retrieved log as raw bytes, or None, if it does not exist.
Expand All @@ -89,7 +89,7 @@ def stream(self, *, raw: bool = False) -> Iterator[impit.Response | None]:
https://docs.apify.com/api/v2#/reference/logs/log/get-log

Args:
raw: If true, the log will include formating. For example, coloring character sequences.
raw: If true, the log will include formatting. For example, coloring character sequences.

Returns:
The retrieved log as a context-managed streaming `Response`, or None, if it does not exist.
Expand Down Expand Up @@ -125,7 +125,7 @@ async def get(self, *, raw: bool = False) -> str | None:
https://docs.apify.com/api/v2#/reference/logs/log/get-log

Args:
raw: If true, the log will include formating. For example, coloring character sequences.
raw: If true, the log will include formatting. For example, coloring character sequences.

Returns:
The retrieved log, or None, if it does not exist.
Expand All @@ -150,7 +150,7 @@ async def get_as_bytes(self, *, raw: bool = False) -> bytes | None:
https://docs.apify.com/api/v2#/reference/logs/log/get-log

Args:
raw: If true, the log will include formating. For example, coloring character sequences.
raw: If true, the log will include formatting. For example, coloring character sequences.

Returns:
The retrieved log as raw bytes, or None, if it does not exist.
Expand All @@ -176,7 +176,7 @@ async def stream(self, *, raw: bool = False) -> AsyncIterator[impit.Response | N
https://docs.apify.com/api/v2#/reference/logs/log/get-log

Args:
raw: If true, the log will include formating. For example, coloring character sequences.
raw: If true, the log will include formatting. For example, coloring character sequences.

Returns:
The retrieved log as a context-managed streaming `Response`, or None, if it does not exist.
Expand Down
4 changes: 2 additions & 2 deletions src/apify_client/clients/resource_clients/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None:
wait_secs: How long does the client wait for run to finish. None for indefinite.
Returns:
The Actor run data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED,
The Actor run data. If the status on the object is not one of the terminal statuses (SUCCEEDED, FAILED,
TIMED_OUT, ABORTED), then the run has not yet finished.
"""
return self._wait_for_finish(wait_secs=wait_secs)
Expand Down Expand Up @@ -424,7 +424,7 @@ async def wait_for_finish(self, *, wait_secs: int | None = None) -> dict | None:
wait_secs: How long does the client wait for run to finish. None for indefinite.
Returns:
The Actor run data. If the status on the object is not one of the terminal statuses (SUCEEDED, FAILED,
The Actor run data. If the status on the object is not one of the terminal statuses (SUCCEEDED, FAILED,
TIMED_OUT, ABORTED), then the run has not yet finished.
"""
return await self._wait_for_finish(wait_secs=wait_secs)
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/test_run_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class TestRunCollectionSync:
def setup_runs(self, apify_client: ApifyClient) -> None:
self.created_runs = []

successfull_run = apify_client.actor(self.APIFY_HELLO_WORLD_ACTOR).call()
if successfull_run is not None:
self.created_runs.append(successfull_run)
successful_run = apify_client.actor(self.APIFY_HELLO_WORLD_ACTOR).call()
if successful_run is not None:
self.created_runs.append(successful_run)

timed_out_run = apify_client.actor(self.APIFY_HELLO_WORLD_ACTOR).call(timeout_secs=1)
if timed_out_run is not None:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async def test_actor_call_redirect_logs_to_default_logger_async(
with caplog.at_level(logging.DEBUG, logger=logger_name):
await actor_client.call()

# Ensure expected handler and formater
# Ensure expected handler and formatter
assert isinstance(logger.handlers[0].formatter, RedirectLogFormatter)
assert isinstance(logger.handlers[0], logging.StreamHandler)

Expand All @@ -294,7 +294,7 @@ def test_actor_call_redirect_logs_to_default_logger_sync(
with caplog.at_level(logging.DEBUG, logger=logger_name):
actor_client.call()

# Ensure expected handler and formater
# Ensure expected handler and formatter
assert isinstance(logger.handlers[0].formatter, RedirectLogFormatter)
assert isinstance(logger.handlers[0], logging.StreamHandler)

Expand Down