diff --git a/docs/04-upgrading/upgrading_to_v20.md b/docs/04-upgrading/upgrading_to_v20.md new file mode 100644 index 00000000..43c18b1a --- /dev/null +++ b/docs/04-upgrading/upgrading_to_v20.md @@ -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` diff --git a/pyproject.toml b/pyproject.toml index 1c929edc..40ffe747 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/website/sidebars.js b/website/sidebars.js index 11c2ab19..06c17b57 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -33,6 +33,17 @@ module.exports = { }, ], }, + { + type: 'category', + label: 'Upgrading', + collapsed: false, + items: [ + { + type: 'autogenerated', + dirName: '04-upgrading', + }, + ], + }, { type: 'doc', id: 'changelog',