apify 2.2.1b6__py3-none-any.whl → 2.2.2b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of apify might be problematic. Click here for more details.

apify/_actor.py CHANGED
@@ -889,7 +889,7 @@ class _ActorType:
889
889
  The system stops the current container and starts a new one, with the same run ID and default storages.
890
890
 
891
891
  Args:
892
- event_listeners_timeout: How long should the Actor wait for Actor event listeners to finish before exiting
892
+ event_listeners_timeout: How long should the Actor wait for Actor event listeners to finish before exiting.
893
893
  custom_after_sleep: How long to sleep for after the reboot, to wait for the container to be stopped.
894
894
  """
895
895
  self._raise_if_not_initialized()
@@ -62,7 +62,7 @@ class ApifyHttpProxyMiddleware:
62
62
  if use_apify_proxy is not True:
63
63
  Actor.log.warning(
64
64
  'ApifyHttpProxyMiddleware is not going to be used. Actor input field '
65
- '"proxyConfiguration.useApifyProxy" is probably set to False.'
65
+ '"proxyConfiguration.useApifyProxy" is set to False.'
66
66
  )
67
67
  raise NotConfigured
68
68
 
apify/scrapy/scheduler.py CHANGED
@@ -3,6 +3,8 @@ from __future__ import annotations
3
3
  import traceback
4
4
  from typing import TYPE_CHECKING
5
5
 
6
+ from crawlee.storage_clients import MemoryStorageClient
7
+
6
8
  from apify._configuration import Configuration
7
9
  from apify.apify_storage_client import ApifyStorageClient
8
10
 
@@ -52,8 +54,15 @@ class ApifyScheduler(BaseScheduler):
52
54
  self.spider = spider
53
55
 
54
56
  async def open_queue() -> RequestQueue:
55
- custom_loop_apify_client = ApifyStorageClient(configuration=Configuration.get_global_configuration())
56
- return await RequestQueue.open(storage_client=custom_loop_apify_client)
57
+ config = Configuration.get_global_configuration()
58
+
59
+ # Use the ApifyStorageClient if the Actor is running on the Apify platform,
60
+ # otherwise use the MemoryStorageClient.
61
+ storage_client = (
62
+ ApifyStorageClient.from_config(config) if config.is_at_home else MemoryStorageClient.from_config(config)
63
+ )
64
+
65
+ return await RequestQueue.open(storage_client=storage_client)
57
66
 
58
67
  try:
59
68
  self._rq = nested_event_loop.run_until_complete(open_queue())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: apify
3
- Version: 2.2.1b6
3
+ Version: 2.2.2b1
4
4
  Summary: Apify SDK for Python
5
5
  License: Apache-2.0
6
6
  Keywords: apify,sdk,automation,chrome,crawlee,crawler,headless,scraper,scraping
@@ -1,5 +1,5 @@
1
1
  apify/__init__.py,sha256=HpgKg2FZWJuSPfDygzJ62psylhw4NN4tKFnoYUIhcd4,838
2
- apify/_actor.py,sha256=e9DeE9vqKzPyiyDO-yRufpqvjAn2sV0KldElWmSTy0I,46137
2
+ apify/_actor.py,sha256=Pb7HPHIAodQOiGtyb-At45x8GfDItWCusRtQkoz1Pq4,46138
3
3
  apify/_configuration.py,sha256=T3Z_o_W98iSyTbrutfb578yW51aexZ_V0FcLwTxFLjI,10878
4
4
  apify/_consts.py,sha256=_Xq4hOfOA1iZ3n1P967YWdyncKivpbX6RTlp_qanUoE,330
5
5
  apify/_crypto.py,sha256=e0_aM3l9_5Osk-jszYOOjrAKK60OggSHbiw5c30QnsU,5638
@@ -20,19 +20,19 @@ apify/log.py,sha256=j-E4t-WeA93bc1NCQRG8sTntehQCiiN8ia-MdQe3_Ts,1291
20
20
  apify/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  apify/scrapy/__init__.py,sha256=HE5wCN7-DZKPydLCOvjNyLuL3CvN2fUFweXfrDfe1Ss,348
22
22
  apify/scrapy/middlewares/__init__.py,sha256=tfW-d3WFWLeNEjL8fTmon6NwgD-OXx1Bw2fBdU-wPy4,114
23
- apify/scrapy/middlewares/apify_proxy.py,sha256=9_-hJqTwQ4yVMjvN9zkJ_GXJADzrrYu8QoHZ6IX6fDs,5764
23
+ apify/scrapy/middlewares/apify_proxy.py,sha256=H8a3vrA_7S_ucRkE3VDNMU8TY2CdzGTMXbhbJbfLv1c,5755
24
24
  apify/scrapy/middlewares/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  apify/scrapy/pipelines/__init__.py,sha256=GWPeLN_Zwj8vRBWtXW6DaxdB7mvyQ7Jw5Tz1ccgWlZI,119
26
26
  apify/scrapy/pipelines/actor_dataset_push.py,sha256=otggoULfUdCqOPJLb9wMROZ9WylnlL-209930tMS2Rg,971
27
27
  apify/scrapy/pipelines/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  apify/scrapy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  apify/scrapy/requests.py,sha256=yZ9hIsz2YyqOoOwzN9F1h76wG4qwawrI6h_6xq0I7Iw,7599
30
- apify/scrapy/scheduler.py,sha256=03kZxejWWb-TofJ-vpSZuQ28rT-qNjhhpC-QeO2OzoU,5977
30
+ apify/scrapy/scheduler.py,sha256=blO333BhFDMu3wAvSQONYdhmAmyiysqsv3YF5FKO_20,6281
31
31
  apify/scrapy/utils.py,sha256=758DcHCSAgCTProY0QX74uJ1XrzVsQwvCmFanj2f_3Q,2928
32
32
  apify/storages/__init__.py,sha256=FW-z6ubuPnHGM-Wp15T8mR5q6lnpDGrCW-IkgZd5L30,177
33
33
  apify/storages/_request_list.py,sha256=-lZJcE5nq69aJhGFJ7Sh2ctqgAWUDyOwYm5_0y1hdAE,5865
34
34
  apify/storages/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- apify-2.2.1b6.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
36
- apify-2.2.1b6.dist-info/METADATA,sha256=vUNYzWoBkXDpltGwfu0yN7pezvrOMiXxYbHPrs7lGeg,8696
37
- apify-2.2.1b6.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
38
- apify-2.2.1b6.dist-info/RECORD,,
35
+ apify-2.2.2b1.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
36
+ apify-2.2.2b1.dist-info/METADATA,sha256=vHXzlhslB1UvfspGitKBpmPXCeqxeRcBgMJ523JtHD8,8696
37
+ apify-2.2.2b1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
38
+ apify-2.2.2b1.dist-info/RECORD,,