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 .github/workflows/build_and_deploy_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
NODE_VERSION: 20
PYTHON_VERSION: 3.13
PYTHON_VERSION: 3.14

jobs:
build_and_deploy_docs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ jobs:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
with:
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

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

unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
secrets:
httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}}
with:
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

update_changelog:
name: Update changelog
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_code_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
with:
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

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

unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
secrets:
httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}}
with:
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

docs_check:
name: Docs check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/templates_e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
NODE_VERSION: 22
PYTHON_VERSION: 3.13
PYTHON_VERSION: 3.14

jobs:
end_to_end_tests:
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries",
]
keywords = [
Expand All @@ -35,7 +36,7 @@ keywords = [
dependencies = [
"cachetools>=5.5.0",
"colorama>=0.4.0",
"impit>=0.6.1",
"impit>=0.8.0",
"more-itertools>=10.2.0",
"protego>=0.5.0",
"psutil>=6.0.0",
Expand Down Expand Up @@ -73,7 +74,7 @@ otel = [
]
sql_postgres = [
"sqlalchemy[asyncio]>=2.0.0,<3.0.0",
"asyncpg>=0.24.0"
"asyncpg>=0.24.0; python_version < '3.14'" # TODO: https://github.com/apify/crawlee-python/issues/1555
]
sql_sqlite = [
"sqlalchemy[asyncio]>=2.0.0,<3.0.0",
Expand Down
9 changes: 9 additions & 0 deletions src/crawlee/storage_clients/_sql/_storage_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import sys
import warnings
from datetime import timedelta
from pathlib import Path
Expand Down Expand Up @@ -268,6 +269,14 @@ def _get_or_create_engine(self, configuration: Configuration) -> AsyncEngine:
'Unsupported database. Supported: sqlite, postgresql. Consider using a different database.'
)

# TODO: https://github.com/apify/crawlee-python/issues/1555
if 'postgresql' in connection_string and sys.version_info >= (3, 14):
raise ValueError(
'SqlStorageClient cannot use PostgreSQL with Python 3.14 '
'due to asyncpg compatibility limitations. '
'Please use Python 3.13 or earlier, or switch to SQLite.'
)

self._engine = create_async_engine(
connection_string,
future=True,
Expand Down
14 changes: 8 additions & 6 deletions tests/unit/_utils/test_system.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import sys
from multiprocessing import Barrier, Process, Value, synchronize
from multiprocessing import get_context, synchronize
from multiprocessing.shared_memory import SharedMemory
from typing import TYPE_CHECKING

Expand Down Expand Up @@ -38,7 +38,9 @@ def test_memory_estimation_does_not_overestimate_due_to_shared_memory() -> None:
equal to additional_memory_size_estimate_per_unshared_memory_child where the additional shared memory is exactly
the same as the unshared memory.
"""
estimated_memory_expectation = Value('b', False) # noqa: FBT003 # Common usage pattern for multiprocessing.Value

ctx = get_context('fork')
estimated_memory_expectation = ctx.Value('b', False) # noqa: FBT003 # Common usage pattern for multiprocessing.Value

def parent_process() -> None:
extra_memory_size = 1024 * 1024 * 100 # 100 MB
Expand Down Expand Up @@ -70,8 +72,8 @@ def get_additional_memory_estimation_while_running_processes(
*, target: Callable, count: int = 1, use_shared_memory: bool = False
) -> float:
processes = []
ready = Barrier(parties=count + 1)
measured = Barrier(parties=count + 1)
ready = ctx.Barrier(parties=count + 1)
measured = ctx.Barrier(parties=count + 1)
shared_memory: None | SharedMemory = None
memory_before = get_memory_info().current_size

Expand All @@ -83,7 +85,7 @@ def get_additional_memory_estimation_while_running_processes(
extra_args = []

for _ in range(count):
p = Process(target=target, args=[ready, measured, *extra_args])
p = ctx.Process(target=target, args=[ready, measured, *extra_args])
p.start()
processes.append(p)

Expand Down Expand Up @@ -129,7 +131,7 @@ def get_additional_memory_estimation_while_running_processes(
f'{memory_estimation_difference_ratio=}'
)

process = Process(target=parent_process)
process = ctx.Process(target=parent_process)
process.start()
process.join()

Expand Down
5 changes: 5 additions & 0 deletions tests/unit/storage_clients/_redis/test_redis_rq_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import json
import sys
from typing import TYPE_CHECKING

import pytest
Expand All @@ -25,6 +26,10 @@ async def rq_client(
suppress_user_warning: None, # noqa: ARG001
) -> AsyncGenerator[RedisRequestQueueClient, None]:
"""A fixture for a Redis RQ client."""
# TODO: https://github.com/apify/crawlee-python/issues/1554
if request.param == 'bloom' and sys.platform == 'win32' and sys.version_info >= (3, 14):
pytest.skip('Bloom filters not supported on Windows with Python 3.14 and fakeredis')

client = await RedisStorageClient(redis=redis_client, queue_dedup_strategy=request.param).create_rq_client(
name='test_request_queue'
)
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading