Skip to content

Commit 143133e

Browse files
committed
Merge remote-tracking branch 'origin/master' into refactor/secondary-arguments-keyword-only
# Conflicts: # docs/04_upgrading/upgrading_to_v4.md
2 parents d0489f4 + b7ba52d commit 143133e

120 files changed

Lines changed: 31279 additions & 30633 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/_checks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
python-version: ${{ matrix.python-version }}
9191

9292
- name: Set up uv package manager
93-
uses: astral-sh/setup-uv@v7
93+
uses: astral-sh/setup-uv@v8.1.0
9494
with:
9595
python-version: ${{ matrix.python-version }}
9696

@@ -150,7 +150,7 @@ jobs:
150150
python-version: ${{ matrix.python-version }}
151151

152152
- name: Set up uv package manager
153-
uses: astral-sh/setup-uv@v7
153+
uses: astral-sh/setup-uv@v8.1.0
154154
with:
155155
python-version: ${{ matrix.python-version }}
156156

.github/workflows/manual_release_docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
python-version: ${{ env.PYTHON_VERSION }}
5353

5454
- name: Set up uv package manager
55-
uses: astral-sh/setup-uv@v7
55+
uses: astral-sh/setup-uv@v8.1.0
5656
with:
5757
python-version: ${{ env.PYTHON_VERSION }}
5858

@@ -85,7 +85,7 @@ jobs:
8585
uses: actions/configure-pages@v6
8686

8787
- name: Upload GitHub Pages artifact
88-
uses: actions/upload-pages-artifact@v4
88+
uses: actions/upload-pages-artifact@v5
8989
with:
9090
path: ./website/build
9191

.github/workflows/manual_version_docs.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
python-version: ${{ env.PYTHON_VERSION }}
6969

7070
- name: Set up uv package manager
71-
uses: astral-sh/setup-uv@v7
71+
uses: astral-sh/setup-uv@v8.1.0
7272
with:
7373
python-version: ${{ env.PYTHON_VERSION }}
7474

@@ -120,10 +120,12 @@ jobs:
120120
echo "No existing versions found for major $MAJOR_VERSION, nothing to remove"
121121
fi
122122
123-
# Build API reference and create Docusaurus version snapshots.
123+
# Build API reference and create Docusaurus version snapshots. The Docusaurus commands must run
124+
# through `uv run` so that the project virtual environment is on PATH — the typedoc-api plugin
125+
# spawns `python` to generate the API reference dump and needs `pydoc-markdown` to be importable.
124126
bash build_api_reference.sh
125-
pnpm exec docusaurus docs:version "$MAJOR_MINOR_VERSION"
126-
pnpm exec docusaurus api:version "$MAJOR_MINOR_VERSION"
127+
uv run pnpm exec docusaurus docs:version "$MAJOR_MINOR_VERSION"
128+
uv run pnpm exec docusaurus api:version "$MAJOR_MINOR_VERSION"
127129
128130
- name: Commit and push versioned docs
129131
uses: apify/actions/signed-commit@v1.2.0

.github/workflows/on_issue.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
# Add the "t-tooling" label to all new issues
21-
- uses: actions/github-script@v8
21+
- uses: actions/github-script@v9
2222
with:
2323
script: |
2424
github.rest.issues.addLabels({

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
All notable changes to this project will be documented in this file.
44

55
<!-- git-cliff-unreleased-start -->
6+
## 3.4.2 - **not yet released**
67

7-
## 4.0.0 - **not yet released**
8+
### 🚜 Refactor
9+
10+
- [**breaking**] Remove deprecated APIs ([#918](https://github.com/apify/apify-sdk-python/pull/918)) ([3e5728d](https://github.com/apify/apify-sdk-python/commit/3e5728d94cb8fd879d5a76e33a03d55792d835d5)) by [@vdusek](https://github.com/vdusek), closes [#635](https://github.com/apify/apify-sdk-python/issues/635)
811

912
### ⚙️ Miscellaneous Tasks
1013

1114
- [**breaking**] Drop Python 3.10 support ([#908](https://github.com/apify/apify-sdk-python/pull/908)) ([a67788e](https://github.com/apify/apify-sdk-python/commit/a67788e4d7845445a3e80a30af70580d2ab84f32)) by [@vdusek](https://github.com/vdusek), closes [#757](https://github.com/apify/apify-sdk-python/issues/757)
1215

16+
1317
<!-- git-cliff-unreleased-end -->
1418

1519
## [3.4.1](https://github.com/apify/apify-sdk-python/releases/tag/v3.4.1) (2026-05-29)
@@ -589,4 +593,4 @@ All notable changes to this project will be documented in this file.
589593
- Key error for storage name ([#28](https://github.com/apify/apify-sdk-python/pull/28)) ([83b30a9](https://github.com/apify/apify-sdk-python/commit/83b30a90df4d3b173302f1c6006b346091fced60)) by [@drobnikj](https://github.com/drobnikj)
590594

591595

592-
<!-- generated by git-cliff -->
596+
<!-- generated by git-cliff -->

docs/04_upgrading/upgrading_to_v4.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,44 @@ Affected signatures:
3030

3131
- `Actor``get_value`, `push_data`, `charge`, `use_state`.
3232
- `ChargingManager``charge`.
33+
34+
## Removal of deprecated APIs
35+
36+
Methods and arguments that had been deprecated in v3 are removed in v4.
37+
38+
### api_public_base_url argument of storage clients
39+
40+
The deprecated `api_public_base_url` argument has been removed from `ApifyDatasetClient` and `ApifyKeyValueStoreClient`. It had no effect already in v3, passing it emitted only a `DeprecationWarning`. Drop it from your call sites. The public base URL is taken from `Configuration.api_public_base_url`, which is unchanged.
41+
42+
```python
43+
# Before (v3)
44+
client = ApifyDatasetClient(
45+
api_client=api_client,
46+
api_public_base_url='https://api.apify.com',
47+
lock=lock,
48+
)
49+
50+
# After (v4)
51+
client = ApifyDatasetClient(
52+
api_client=api_client,
53+
lock=lock,
54+
)
55+
```
56+
57+
### Actor.start and Actor.call: RemainingTime
58+
59+
The deprecated `RemainingTime` value of the `timeout` argument has been removed from `Actor.start()` and `Actor.call()`. Use `inherit` instead, the signature and behavior are identical.
60+
61+
```python
62+
# Before (v3)
63+
run = await Actor.call('user/actor', timeout='RemainingTime')
64+
65+
# After (v4)
66+
run = await Actor.call('user/actor', timeout='inherit')
67+
```
68+
69+
### Deprecated Configuration fields
70+
71+
The deprecated `latest_sdk_version`, `log_format`, and `standby_port` fields have been removed from `Configuration`:
72+
- In place of `standby_port`, use `web_server_port`.
73+
- `latest_sdk_version` and `log_format` don't have replacement. SDK version checking isn't supported for the Python SDK and the log format should be adjusted in code instead.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ dev = [
8484
"ruff~=0.15.0",
8585
"setuptools", # setuptools are used by pytest but not explicitly required
8686
"ty~=0.0.0",
87-
"types-cachetools<7.0.0",
87+
"types-cachetools<7.0.1",
8888
"uvicorn[standard]",
8989
"werkzeug<4.0.0", # Werkzeug is used by httpserver
9090
]

src/apify/_actor.py

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import asyncio
44
import sys
5-
import warnings
65
from contextlib import suppress
76
from datetime import UTC, datetime, timedelta
87
from functools import cached_property
@@ -867,7 +866,7 @@ async def start(
867866
max_total_charge_usd: Decimal | None = None,
868867
restart_on_error: bool | None = None,
869868
memory_mbytes: int | None = None,
870-
timeout: timedelta | None | Literal['inherit', 'RemainingTime'] = None,
869+
timeout: timedelta | None | Literal['inherit'] = None,
871870
force_permission_level: ActorPermissionLevel | None = None,
872871
wait_for_finish: int | None = None,
873872
webhooks: list[Webhook] | None = None,
@@ -889,8 +888,8 @@ async def start(
889888
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit specified
890889
in the default run configuration for the Actor.
891890
timeout: Optional timeout for the run, in seconds. By default, the run uses timeout specified in
892-
the default run configuration for the Actor. Using `inherit` or `RemainingTime` will set timeout of the
893-
other Actor to the time remaining from this Actor timeout.
891+
the default run configuration for the Actor. Using `inherit` will set timeout of the other Actor
892+
to the time remaining from this Actor timeout.
894893
force_permission_level: Override the Actor's permissions for this run. If not set, the Actor will run
895894
with permissions configured in the Actor settings.
896895
wait_for_finish: The maximum number of seconds the server waits for the run to finish. By default,
@@ -911,22 +910,14 @@ async def start(
911910
else:
912911
serialized_webhooks = None
913912

914-
if timeout in {'inherit', 'RemainingTime'}:
915-
if timeout == 'RemainingTime':
916-
warnings.warn(
917-
'`RemainingTime` is deprecated and will be removed in version 4.0.0. Use `inherit` instead.',
918-
DeprecationWarning,
919-
stacklevel=2,
920-
)
913+
if timeout == 'inherit':
921914
actor_start_timeout = self._get_remaining_time()
922915
elif timeout is None:
923916
actor_start_timeout = None
924917
elif isinstance(timeout, timedelta):
925918
actor_start_timeout = timeout
926919
else:
927-
raise ValueError(
928-
f'Invalid timeout {timeout!r}: expected `None`, `"inherit"`, `"RemainingTime"`, or a `timedelta`.'
929-
)
920+
raise ValueError(f'Invalid timeout {timeout!r}: expected `None`, `"inherit"`, or a `timedelta`.')
930921

931922
api_result = await client.actor(actor_id).start(
932923
run_input=run_input,
@@ -988,7 +979,7 @@ async def call(
988979
max_total_charge_usd: Decimal | None = None,
989980
restart_on_error: bool | None = None,
990981
memory_mbytes: int | None = None,
991-
timeout: timedelta | None | Literal['inherit', 'RemainingTime'] = None,
982+
timeout: timedelta | None | Literal['inherit'] = None,
992983
force_permission_level: ActorPermissionLevel | None = None,
993984
webhooks: list[Webhook] | None = None,
994985
wait: timedelta | None = None,
@@ -1011,8 +1002,8 @@ async def call(
10111002
memory_mbytes: Memory limit for the run, in megabytes. By default, the run uses a memory limit specified
10121003
in the default run configuration for the Actor.
10131004
timeout: Optional timeout for the run, in seconds. By default, the run uses timeout specified in
1014-
the default run configuration for the Actor. Using `inherit` or `RemainingTime` will set timeout of the
1015-
other Actor to the time remaining from this Actor timeout.
1005+
the default run configuration for the Actor. Using `inherit` will set timeout of the other Actor
1006+
to the time remaining from this Actor timeout.
10161007
force_permission_level: Override the Actor's permissions for this run. If not set, the Actor will run
10171008
with permissions configured in the Actor settings.
10181009
webhooks: Optional webhooks (https://docs.apify.com/webhooks) associated with the Actor run, which can
@@ -1036,23 +1027,14 @@ async def call(
10361027
else:
10371028
serialized_webhooks = None
10381029

1039-
if timeout in {'inherit', 'RemainingTime'}:
1040-
if timeout == 'RemainingTime':
1041-
warnings.warn(
1042-
'`RemainingTime` is deprecated and will be removed in version 4.0.0. Use `inherit` instead.',
1043-
DeprecationWarning,
1044-
stacklevel=2,
1045-
)
1046-
1030+
if timeout == 'inherit':
10471031
actor_call_timeout = self._get_remaining_time()
10481032
elif timeout is None:
10491033
actor_call_timeout = None
10501034
elif isinstance(timeout, timedelta):
10511035
actor_call_timeout = timeout
10521036
else:
1053-
raise ValueError(
1054-
f'Invalid timeout {timeout!r}: expected `None`, `"inherit"`, `"RemainingTime"`, or a `timedelta`.'
1055-
)
1037+
raise ValueError(f'Invalid timeout {timeout!r}: expected `None`, `"inherit"`, or a `timedelta`.')
10561038

10571039
api_result = await client.actor(actor_id).call(
10581040
run_input=run_input,
@@ -1451,7 +1433,7 @@ def _get_remaining_time(self) -> timedelta | None:
14511433
return max(self.configuration.timeout_at - datetime.now(tz=UTC), timedelta(0))
14521434

14531435
self.log.warning(
1454-
'Using `inherit` or `RemainingTime` argument is only possible when the Actor'
1436+
'Using `inherit` argument is only possible when the Actor'
14551437
' is running on the Apify platform and when the timeout for the Actor run is set. '
14561438
f'{self.is_at_home()=}, {self.configuration.timeout_at=}'
14571439
)

src/apify/_configuration.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import Annotated, Any, Self
99

1010
from pydantic import AliasChoices, BeforeValidator, Field, model_validator
11-
from typing_extensions import TypedDict, deprecated
11+
from typing_extensions import TypedDict
1212

1313
from crawlee import service_locator
1414
from crawlee._utils.models import timedelta_ms
@@ -273,22 +273,6 @@ class Configuration(CrawleeConfiguration):
273273
),
274274
] = False
275275

276-
latest_sdk_version: Annotated[
277-
str | None,
278-
Field(
279-
alias='apify_sdk_latest_version',
280-
description='Specifies the most recent release version of the Apify SDK for Javascript. Used for '
281-
'checking for updates.',
282-
),
283-
deprecated('SDK version checking is not supported for the Python SDK'),
284-
] = None
285-
286-
log_format: Annotated[
287-
str | None,
288-
Field(alias='apify_log_format'),
289-
deprecated('Adjust the log format in code instead'),
290-
] = None
291-
292276
max_paid_dataset_items: Annotated[
293277
int | None,
294278
Field(
@@ -386,15 +370,6 @@ class Configuration(CrawleeConfiguration):
386370
BeforeValidator(lambda val: val if val != '' else None), # We should accept empty environment variables as well
387371
] = None
388372

389-
standby_port: Annotated[
390-
int,
391-
Field(
392-
alias='actor_standby_port',
393-
description='TCP port for the Actor to start an HTTP server to receive messages in the Actor Standby mode',
394-
),
395-
deprecated('Use `web_server_port` instead'),
396-
] = 4321
397-
398373
standby_url: Annotated[
399374
str,
400375
BeforeValidator(validate_http_url),

src/apify/storage_clients/_apify/_dataset_client.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import asyncio
4-
import warnings
54
from logging import getLogger
65
from typing import TYPE_CHECKING
76

@@ -42,7 +41,6 @@ def __init__(
4241
self,
4342
*,
4443
api_client: DatasetClientAsync,
45-
api_public_base_url: str,
4644
lock: asyncio.Lock,
4745
) -> None:
4846
"""Initialize a new instance.
@@ -58,14 +56,6 @@ def __init__(
5856
self._lock = lock
5957
"""A lock to ensure that only one operation is performed at a time."""
6058

61-
if api_public_base_url:
62-
# Remove in version 4.0, https://github.com/apify/apify-sdk-python/issues/635
63-
warnings.warn(
64-
'api_public_base_url argument is deprecated and will be removed in version 4.0.0',
65-
DeprecationWarning,
66-
stacklevel=2,
67-
)
68-
6959
@override
7060
async def get_metadata(self) -> DatasetMetadata:
7161
metadata = await self._api_client.get()
@@ -114,7 +104,6 @@ async def open(
114104

115105
dataset_client = cls(
116106
api_client=api_client,
117-
api_public_base_url='', # Remove in version 4.0, https://github.com/apify/apify-sdk-python/issues/635
118107
lock=asyncio.Lock(),
119108
)
120109

0 commit comments

Comments
 (0)