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
8 changes: 8 additions & 0 deletions .github/workflows/run_code_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ jobs:
lint_check:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
with:
python-version: '["3.10", "3.11", "3.12", "3.13"]'

type_check:
name: Type check
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
with:
python-version: '["3.10", "3.11", "3.12", "3.13"]'

unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
with:
python-version: '["3.10", "3.11", "3.12", "3.13"]'

async_docstrings:
name: Async dostrings check
Expand All @@ -31,4 +37,6 @@ jobs:
name: Integration tests
needs: [lint_check, type_check, unit_tests]
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
with:
python-version: '["3.10", "3.11", "3.12", "3.13"]'
secrets: inherit
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Here you'll find a contributing guide to get started with development.

## Environment

For local development, it is required to have Python 3.9 (or a later version) installed.
For local development, it is required to have Python 3.10 (or a later version) installed.

We use [uv](https://docs.astral.sh/uv/) for project management. Install it and set up your IDE accordingly.

Expand Down
2 changes: 1 addition & 1 deletion docs/01_overview/02_setting_up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This guide will help you get started with [Apify client for Python](https://gith

Before installing `apify-client` itself, make sure that your system meets the following requirements:

- **Python 3.9 or higher**: `apify-client` requires Python 3.9 or a newer version. You can download Python from the [official website](https://www.python.org/downloads/).
- **Python 3.10 or higher**: `apify-client` requires Python 3.10 or a newer version. You can download Python from the [official website](https://www.python.org/downloads/).
- **Python package manager**: While this guide uses Pip (the most common package manager), you can also use any package manager you want. You can download Pip from the [official website](https://pip.pypa.io/en/stable/installation/).

### Verifying prerequisites
Expand Down
19 changes: 10 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ description = "Apify API client for Python"
authors = [{ name = "Apify Technologies s.r.o.", email = "support@apify.com" }]
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -31,12 +31,13 @@ dependencies = [
]

[project.urls]
"Apify Homepage" = "https://apify.com"
"Homepage" = "https://docs.apify.com/api/client/python/"
"Apify homepage" = "https://apify.com"
"Changelog" = "https://github.com/apify/apify-client-python/blob/master/CHANGELOG.md"
"Documentation" = "https://docs.apify.com/api/client/python/"
"Issue tracker" = "https://github.com/apify/apify-client-python/issues"
"Repository" = "https://github.com/apify/apify-client-python"
"Changelog" = "https://docs.apify.com/api/client/python/docs/changelog"
"Discord" = "https://discord.com/invite/jyEM2PRvMU"
"Documentation" = "https://docs.apify.com/api/client/python/docs/overview/introduction"
"Issue Tracker" = "https://github.com/apify/apify-client-python/issues"
"Source Code" = "https://github.com/apify/apify-client-python"

[dependency-groups]
dev = [
Expand Down Expand Up @@ -156,7 +157,7 @@ asyncio_mode = "auto"
timeout = 1200

[tool.mypy]
python_version = "3.9"
python_version = "3.10"
files = ["src", "tests", "scripts", "docs", "website"]
check_untyped_defs = true
disallow_incomplete_defs = true
Expand All @@ -175,7 +176,7 @@ module = ["pandas", "respx"]
ignore_missing_imports = true

[tool.basedpyright]
pythonVersion = "3.9"
pythonVersion = "3.10"
typeCheckingMode = "standard"
include = ["src", "tests", "scripts", "docs", "website"]

Expand Down
5 changes: 3 additions & 2 deletions src/apify_client/_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
from http import HTTPStatus
from importlib import metadata
from typing import TYPE_CHECKING, Any, Callable
from typing import TYPE_CHECKING, Any

import httpx
from apify_shared.utils import ignore_docs, is_content_type_json, is_content_type_text, is_content_type_xml
Expand All @@ -18,8 +18,9 @@
from apify_client._utils import retry_with_exp_backoff, retry_with_exp_backoff_async

if TYPE_CHECKING:
from apify_shared.types import JSONSerializable
from collections.abc import Callable

from apify_shared.types import JSONSerializable

DEFAULT_BACKOFF_EXPONENTIAL_FACTOR = 2
DEFAULT_BACKOFF_RANDOM_FACTOR = 1
Expand Down
6 changes: 4 additions & 2 deletions src/apify_client/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
import json
import logging
from contextvars import ContextVar
from typing import TYPE_CHECKING, Any, Callable, NamedTuple
from typing import TYPE_CHECKING, Any, NamedTuple

from colorama import Fore, Style

# Conditional import only executed when type checking, otherwise we'd get circular dependency issues
if TYPE_CHECKING:
from collections.abc import Callable

from apify_client.clients.base.base_client import _BaseBaseClient


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

Expand Down
3 changes: 2 additions & 1 deletion src/apify_client/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import json
import random
import time
from collections.abc import Callable
from http import HTTPStatus
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
from typing import TYPE_CHECKING, Any, TypeVar, cast

from apify_shared.utils import is_file_or_bytes, maybe_extract_enum_member_value

Expand Down
2 changes: 1 addition & 1 deletion src/apify_client/clients/resource_clients/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _log_buffer_content(self, *, include_last_part: bool = False) -> None:
# The last two parts (marker and message) are possibly not complete and will be left in the buffer
self._stream_buffer = all_parts[-2:]

for marker, content in zip(message_markers, message_contents):
for marker, content in zip(message_markers, message_contents, strict=False):
decoded_marker = marker.decode('utf-8')
decoded_content = content.decode('utf-8')
if self._relevancy_time_limit:
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import time
from typing import Any, Callable
from collections.abc import Callable
from typing import Any

import pytest
from apify_shared.consts import WebhookEventType
Expand Down
Loading