Skip to content

Commit 768b7b5

Browse files
authored
chore: Bump minimum Python version to 3.10 (#432)
1 parent 2737376 commit 768b7b5

File tree

10 files changed

+36
-116
lines changed

10 files changed

+36
-116
lines changed

.github/workflows/run_code_checks.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ jobs:
1010
lint_check:
1111
name: Lint check
1212
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
13+
with:
14+
python-version: '["3.10", "3.11", "3.12", "3.13"]'
1315

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

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

2228
async_docstrings:
2329
name: Async dostrings check
@@ -31,4 +37,6 @@ jobs:
3137
name: Integration tests
3238
needs: [lint_check, type_check, unit_tests]
3339
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
40+
with:
41+
python-version: '["3.10", "3.11", "3.12", "3.13"]'
3442
secrets: inherit

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Here you'll find a contributing guide to get started with development.
44

55
## Environment
66

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

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

docs/01_overview/02_setting_up.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This guide will help you get started with [Apify client for Python](https://gith
1616

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

19-
- **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/).
19+
- **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/).
2020
- **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/).
2121

2222
### Verifying prerequisites

pyproject.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ description = "Apify API client for Python"
99
authors = [{ name = "Apify Technologies s.r.o.", email = "[email protected]" }]
1010
license = { file = "LICENSE" }
1111
readme = "README.md"
12-
requires-python = ">=3.9"
12+
requires-python = ">=3.10"
1313
classifiers = [
1414
"Development Status :: 5 - Production/Stable",
15+
"Environment :: Console",
1516
"Intended Audience :: Developers",
1617
"License :: OSI Approved :: Apache Software License",
1718
"Operating System :: OS Independent",
18-
"Programming Language :: Python :: 3.9",
1919
"Programming Language :: Python :: 3.10",
2020
"Programming Language :: Python :: 3.11",
2121
"Programming Language :: Python :: 3.12",
@@ -31,12 +31,13 @@ dependencies = [
3131
]
3232

3333
[project.urls]
34+
"Apify Homepage" = "https://apify.com"
3435
"Homepage" = "https://docs.apify.com/api/client/python/"
35-
"Apify homepage" = "https://apify.com"
36-
"Changelog" = "https://github.com/apify/apify-client-python/blob/master/CHANGELOG.md"
37-
"Documentation" = "https://docs.apify.com/api/client/python/"
38-
"Issue tracker" = "https://github.com/apify/apify-client-python/issues"
39-
"Repository" = "https://github.com/apify/apify-client-python"
36+
"Changelog" = "https://docs.apify.com/api/client/python/docs/changelog"
37+
"Discord" = "https://discord.com/invite/jyEM2PRvMU"
38+
"Documentation" = "https://docs.apify.com/api/client/python/docs/overview/introduction"
39+
"Issue Tracker" = "https://github.com/apify/apify-client-python/issues"
40+
"Source Code" = "https://github.com/apify/apify-client-python"
4041

4142
[dependency-groups]
4243
dev = [
@@ -156,7 +157,7 @@ asyncio_mode = "auto"
156157
timeout = 1200
157158

158159
[tool.mypy]
159-
python_version = "3.9"
160+
python_version = "3.10"
160161
files = ["src", "tests", "scripts", "docs", "website"]
161162
check_untyped_defs = true
162163
disallow_incomplete_defs = true
@@ -175,7 +176,7 @@ module = ["pandas", "respx"]
175176
ignore_missing_imports = true
176177

177178
[tool.basedpyright]
178-
pythonVersion = "3.9"
179+
pythonVersion = "3.10"
179180
typeCheckingMode = "standard"
180181
include = ["src", "tests", "scripts", "docs", "website"]
181182

src/apify_client/_http_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sys
88
from http import HTTPStatus
99
from importlib import metadata
10-
from typing import TYPE_CHECKING, Any, Callable
10+
from typing import TYPE_CHECKING, Any
1111

1212
import httpx
1313
from apify_shared.utils import ignore_docs, is_content_type_json, is_content_type_text, is_content_type_xml
@@ -18,8 +18,9 @@
1818
from apify_client._utils import retry_with_exp_backoff, retry_with_exp_backoff_async
1919

2020
if TYPE_CHECKING:
21-
from apify_shared.types import JSONSerializable
21+
from collections.abc import Callable
2222

23+
from apify_shared.types import JSONSerializable
2324

2425
DEFAULT_BACKOFF_EXPONENTIAL_FACTOR = 2
2526
DEFAULT_BACKOFF_RANDOM_FACTOR = 1

src/apify_client/_logging.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
import json
66
import logging
77
from contextvars import ContextVar
8-
from typing import TYPE_CHECKING, Any, Callable, NamedTuple
8+
from typing import TYPE_CHECKING, Any, NamedTuple
99

1010
from colorama import Fore, Style
1111

12-
# Conditional import only executed when type checking, otherwise we'd get circular dependency issues
1312
if TYPE_CHECKING:
13+
from collections.abc import Callable
14+
1415
from apify_client.clients.base.base_client import _BaseBaseClient
1516

17+
1618
# Name of the logger used throughout the library
1719
logger_name = __name__.split('.')[0]
1820

src/apify_client/_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import json
66
import random
77
import time
8+
from collections.abc import Callable
89
from http import HTTPStatus
9-
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
10+
from typing import TYPE_CHECKING, Any, TypeVar, cast
1011

1112
from apify_shared.utils import is_file_or_bytes, maybe_extract_enum_member_value
1213

src/apify_client/clients/resource_clients/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _log_buffer_content(self, *, include_last_part: bool = False) -> None:
262262
# The last two parts (marker and message) are possibly not complete and will be left in the buffer
263263
self._stream_buffer = all_parts[-2:]
264264

265-
for marker, content in zip(message_markers, message_contents):
265+
for marker, content in zip(message_markers, message_contents, strict=False):
266266
decoded_marker = marker.decode('utf-8')
267267
decoded_content = content.decode('utf-8')
268268
if self._relevancy_time_limit:

tests/unit/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import time
2-
from typing import Any, Callable
2+
from collections.abc import Callable
3+
from typing import Any
34

45
import pytest
56
from apify_shared.consts import WebhookEventType

0 commit comments

Comments
 (0)