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
36 changes: 36 additions & 0 deletions docs/04-upgrading/upgrading_to_v20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
id: upgrading-to-v20
title: Upgrading to v2.0
---

This page summarizes most of the breaking changes between Apify Python SDK v1.x and v2.0.

## Storages

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.

Removing the `StorageClientManager` class is a significant change. If you need to change the storage client, use `crawlee.service_container` instead.

## Configuration

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`.

Attributes suffixed with `_millis` were renamed to remove said suffix and have the `datetime.timedelta` type now.

## Actor

The `Actor.main` method has been removed as it brings no benefits compared to using `async with Actor`.

## Scrapy integration

The `apify.scrapy.utils.open_queue_with_custom_client` function is not necessary anymore and has been removed.

## Subpackage visibility

The following modules were made private:

- `apify.proxy_configuration` (`ProxyConfiguration` is still exported from `apify`)
- `apify.config` (`Configuration` is still exported from `apify`)
- `apify.actor` (`Actor` is still exported from `apify`)
- `apify.event_manager`
- `apify.consts`
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ websockets = ">=10.0"
[tool.poetry.group.dev.dependencies]
build = "~1.2.0"
filelock = "~3.15.0"
griffe = "~1.2.0"
mypy = "~1.11.0"
pre-commit = "~3.8.0"
pydoc-markdown = "~4.8.0"
Expand Down
11 changes: 11 additions & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ module.exports = {
},
],
},
{
type: 'category',
label: 'Upgrading',
collapsed: false,
items: [
{
type: 'autogenerated',
dirName: '04-upgrading',
},
],
},
{
type: 'doc',
id: 'changelog',
Expand Down