You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/04_upgrading/upgrading_to_v3.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,38 @@ This page summarizes the breaking changes between Apify Python SDK v2.x and v3.0
9
9
10
10
Support for Python 3.9 has been dropped. The Apify Python SDK v3.x now requires Python 3.10 or later. Make sure your environment is running a compatible version before upgrading.
11
11
12
+
## Actor initialization and ServiceLocator changes
13
+
14
+
`Actor` initialization and global `service_locator` services setup is more strict and predictable.
15
+
- Services in `Actor` can't be changed after calling `Actor.init`, entering the `async with Actor` context manager or after requesting them from the `Actor`
16
+
- Services in `Actor` can be different from services in Crawler
17
+
18
+
**Now (v3.0):**
19
+
20
+
```python
21
+
from crawlee.crawlers import BasicCrawler
22
+
from crawlee.storage_clients import MemoryStorageClient, FileSystemStorageClient
23
+
from crawlee.configuration import Configuration
24
+
from crawlee.events import LocalEventManager
25
+
from apify import Actor
26
+
27
+
asyncdefmain():
28
+
29
+
asyncwith Actor():
30
+
# This crawler will use same services as Actor and global service_locator
0 commit comments