Skip to content

Commit 8e86946

Browse files
committed
Add v2.0 upgrading guide
1 parent 22677f5 commit 8e86946

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
id: upgrading-to-v20
3+
title: Upgrading to v2.0
4+
---
5+
6+
This page summarizes most of the breaking changes between Apify Python SDK v1.x and v2.0.
7+
8+
# Storages
9+
10+
The SDK now uses [crawlee](https://github.com/apify/crawlee-python) for local storage emulation. This change should not affect intended usage (working with `Dataset`, `KeyValueStore` and `RequestQueue` classes from the `apify.storages` module or using the shortcuts exposed by the `Actor` class) in any way.
11+
12+
Removing the `StorageClientManager` class is a significant change. If you need to change the storage client, use `crawlee.service_container` instead.
13+
14+
# Configuration
15+
16+
The `apify.Configuration` class now uses `pydantic_settings` to load configuration from environment variables. This eliminates the need for the helper functions which handled environment variables in `apify._utils`.
17+
18+
Attributes suffixed with `_millis` were renamed to remove said suffix and have the `datetime.timedelta` type now.
19+
20+
# Actor
21+
22+
The `Actor.main` method has been removed as it brings no benefits compared to using `async with Actor`.
23+
24+
# Scrapy integration
25+
26+
The `apify.scrapy.utils.open_queue_with_custom_client` function is not necessary anymore and has been removed.
27+
28+
# Subpackage visibility
29+
30+
The following modules were made private:
31+
32+
- `apify.proxy_configuration` (`ProxyConfiguration` is still exported from `apify`)
33+
- `apify.config` (`Configuration` is still exported from `apify`)
34+
- `apify.actor` (`Actor` is still exported from `apify`)
35+
- `apify.event_manager`
36+
- `apify.consts`

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ twine = "^5.1.0"
8181
types-aiofiles = "^24.1.0.20240626"
8282
types-colorama = "^0.4.15.20240311"
8383
types-psutil = "^6.0.0.20240621"
84+
griffe = "^1.2.0"
8485

8586
[tool.poetry.extras]
8687
scrapy = ["scrapy"]

website/sidebars.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ module.exports = {
3333
},
3434
],
3535
},
36+
{
37+
type: 'category',
38+
label: 'Upgrading',
39+
collapsed: false,
40+
items: [
41+
{
42+
type: 'autogenerated',
43+
dirName: '04-upgrading',
44+
},
45+
],
46+
},
3647
{
3748
type: 'doc',
3849
id: 'changelog',

0 commit comments

Comments
 (0)