Skip to content

Commit 71141a8

Browse files
authored
docs: Add v2.0 upgrading guide (#255)
1 parent 13002d1 commit 71141a8

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
@@ -59,6 +59,7 @@ websockets = ">=10.0"
5959
[tool.poetry.group.dev.dependencies]
6060
build = "~1.2.0"
6161
filelock = "~3.15.0"
62+
griffe = "~1.2.0"
6263
mypy = "~1.11.0"
6364
pre-commit = "~3.8.0"
6465
pydoc-markdown = "~4.8.0"

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)