apify 1.7.1__py3-none-any.whl → 1.7.1b2__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 +11 -17
- {apify-1.7.1.dist-info → apify-1.7.1b2.dist-info}/METADATA +18 -18
- {apify-1.7.1.dist-info → apify-1.7.1b2.dist-info}/RECORD +6 -6
- {apify-1.7.1.dist-info → apify-1.7.1b2.dist-info}/LICENSE +0 -0
- {apify-1.7.1.dist-info → apify-1.7.1b2.dist-info}/WHEEL +0 -0
- {apify-1.7.1.dist-info → apify-1.7.1b2.dist-info}/top_level.txt +0 -0
apify/actor.py
CHANGED
|
@@ -5,7 +5,7 @@ import contextlib
|
|
|
5
5
|
import inspect
|
|
6
6
|
import os
|
|
7
7
|
import sys
|
|
8
|
-
from datetime import datetime,
|
|
8
|
+
from datetime import datetime, timezone
|
|
9
9
|
from typing import TYPE_CHECKING, Any, Awaitable, Callable, TypeVar, cast
|
|
10
10
|
|
|
11
11
|
from apify_client import ApifyClientAsync
|
|
@@ -301,7 +301,6 @@ class Actor(metaclass=_ActorContextManager):
|
|
|
301
301
|
exit_code: int = 0,
|
|
302
302
|
event_listeners_timeout_secs: float | None = EVENT_LISTENERS_TIMEOUT_SECS,
|
|
303
303
|
status_message: str | None = None,
|
|
304
|
-
cleanup_timeout: timedelta = timedelta(seconds=30),
|
|
305
304
|
) -> None:
|
|
306
305
|
"""Exit the actor instance.
|
|
307
306
|
|
|
@@ -315,13 +314,11 @@ class Actor(metaclass=_ActorContextManager):
|
|
|
315
314
|
exit_code (int, optional): The exit code with which the actor should fail (defaults to `0`).
|
|
316
315
|
event_listeners_timeout_secs (float, optional): How long should the actor wait for actor event listeners to finish before exiting.
|
|
317
316
|
status_message (str, optional): The final status message that the actor should display.
|
|
318
|
-
cleanup_timeout (timedelta, optional): How long we should wait for event listeners.
|
|
319
317
|
"""
|
|
320
318
|
return await cls._get_default_instance().exit(
|
|
321
319
|
exit_code=exit_code,
|
|
322
320
|
event_listeners_timeout_secs=event_listeners_timeout_secs,
|
|
323
321
|
status_message=status_message,
|
|
324
|
-
cleanup_timeout=cleanup_timeout,
|
|
325
322
|
)
|
|
326
323
|
|
|
327
324
|
async def _exit_internal(
|
|
@@ -330,7 +327,6 @@ class Actor(metaclass=_ActorContextManager):
|
|
|
330
327
|
exit_code: int = 0,
|
|
331
328
|
event_listeners_timeout_secs: float | None = EVENT_LISTENERS_TIMEOUT_SECS,
|
|
332
329
|
status_message: str | None = None,
|
|
333
|
-
cleanup_timeout: timedelta = timedelta(seconds=30),
|
|
334
330
|
) -> None:
|
|
335
331
|
self._raise_if_not_initialized()
|
|
336
332
|
|
|
@@ -340,23 +336,21 @@ class Actor(metaclass=_ActorContextManager):
|
|
|
340
336
|
|
|
341
337
|
self.log.info('Exiting actor', extra={'exit_code': exit_code})
|
|
342
338
|
|
|
343
|
-
|
|
344
|
-
await self._cancel_event_emitting_intervals()
|
|
339
|
+
await self._cancel_event_emitting_intervals()
|
|
345
340
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
341
|
+
# Send final persist state event
|
|
342
|
+
if not self._was_final_persist_state_emitted:
|
|
343
|
+
self._event_manager.emit(ActorEventTypes.PERSIST_STATE, {'isMigrating': False})
|
|
344
|
+
self._was_final_persist_state_emitted = True
|
|
350
345
|
|
|
351
|
-
|
|
352
|
-
|
|
346
|
+
if status_message is not None:
|
|
347
|
+
await self.set_status_message(status_message, is_terminal=True)
|
|
353
348
|
|
|
354
|
-
|
|
355
|
-
|
|
349
|
+
# Sleep for a bit so that the listeners have a chance to trigger
|
|
350
|
+
await asyncio.sleep(0.1)
|
|
356
351
|
|
|
357
|
-
|
|
352
|
+
await self._event_manager.close(event_listeners_timeout_secs=event_listeners_timeout_secs)
|
|
358
353
|
|
|
359
|
-
await asyncio.wait_for(finalize(), cleanup_timeout.total_seconds())
|
|
360
354
|
self._is_initialized = False
|
|
361
355
|
|
|
362
356
|
if is_running_in_ipython():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apify
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.1b2
|
|
4
4
|
Summary: Apify SDK for Python
|
|
5
5
|
Author-email: "Apify Technologies s.r.o." <support@apify.com>
|
|
6
6
|
License: Apache Software License
|
|
@@ -37,23 +37,23 @@ Requires-Dist: sortedcollections >=2.0.1
|
|
|
37
37
|
Requires-Dist: typing-extensions >=4.1.0
|
|
38
38
|
Requires-Dist: websockets >=10.1
|
|
39
39
|
Provides-Extra: dev
|
|
40
|
-
Requires-Dist: build ~=1.
|
|
41
|
-
Requires-Dist: filelock ~=3.
|
|
42
|
-
Requires-Dist: mypy ~=1.
|
|
43
|
-
Requires-Dist: pre-commit ~=3.
|
|
44
|
-
Requires-Dist: pydoc-markdown ~=4.8.
|
|
45
|
-
Requires-Dist: pytest ~=
|
|
46
|
-
Requires-Dist: pytest-asyncio ~=0.
|
|
47
|
-
Requires-Dist: pytest-cov ~=
|
|
48
|
-
Requires-Dist: pytest-only ~=2.
|
|
49
|
-
Requires-Dist: pytest-timeout ~=2.
|
|
50
|
-
Requires-Dist: pytest-xdist ~=3.
|
|
51
|
-
Requires-Dist: respx ~=0.
|
|
52
|
-
Requires-Dist: ruff ~=0.
|
|
53
|
-
Requires-Dist: twine ~=
|
|
54
|
-
Requires-Dist: types-aiofiles ~=23.2.0.
|
|
55
|
-
Requires-Dist: types-colorama ~=0.4.15.
|
|
56
|
-
Requires-Dist: types-psutil ~=5.9.5.
|
|
40
|
+
Requires-Dist: build ~=1.0.3 ; extra == 'dev'
|
|
41
|
+
Requires-Dist: filelock ~=3.12.4 ; extra == 'dev'
|
|
42
|
+
Requires-Dist: mypy ~=1.7.1 ; extra == 'dev'
|
|
43
|
+
Requires-Dist: pre-commit ~=3.4.0 ; extra == 'dev'
|
|
44
|
+
Requires-Dist: pydoc-markdown ~=4.8.2 ; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest ~=7.4.2 ; extra == 'dev'
|
|
46
|
+
Requires-Dist: pytest-asyncio ~=0.21.0 ; extra == 'dev'
|
|
47
|
+
Requires-Dist: pytest-cov ~=4.1.0 ; extra == 'dev'
|
|
48
|
+
Requires-Dist: pytest-only ~=2.0.0 ; extra == 'dev'
|
|
49
|
+
Requires-Dist: pytest-timeout ~=2.2.0 ; extra == 'dev'
|
|
50
|
+
Requires-Dist: pytest-xdist ~=3.3.1 ; extra == 'dev'
|
|
51
|
+
Requires-Dist: respx ~=0.20.1 ; extra == 'dev'
|
|
52
|
+
Requires-Dist: ruff ~=0.1.13 ; extra == 'dev'
|
|
53
|
+
Requires-Dist: twine ~=4.0.2 ; extra == 'dev'
|
|
54
|
+
Requires-Dist: types-aiofiles ~=23.2.0.0 ; extra == 'dev'
|
|
55
|
+
Requires-Dist: types-colorama ~=0.4.15.12 ; extra == 'dev'
|
|
56
|
+
Requires-Dist: types-psutil ~=5.9.5.17 ; extra == 'dev'
|
|
57
57
|
Provides-Extra: scrapy
|
|
58
58
|
Requires-Dist: scrapy >=2.11.0 ; extra == 'scrapy'
|
|
59
59
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apify/__init__.py,sha256=aAjho-r0-XAqUjD9j55ueCo4lZJzyytOWjk0VCmkeeY,283
|
|
2
2
|
apify/_crypto.py,sha256=mbqwfgVz7efAw6ko1PTtpaaRqlBvTi-oskiZmWufTrk,5822
|
|
3
3
|
apify/_utils.py,sha256=7_iHGRw8AZA7ITStg5cN8k_ZmqMKdAQ_ev2ZRcO3X0M,16963
|
|
4
|
-
apify/actor.py,sha256=
|
|
4
|
+
apify/actor.py,sha256=v_hefwMXy2qCIBjcZvVHE9zdHg2jut0Xuf6IodX_vvo,59997
|
|
5
5
|
apify/config.py,sha256=mPbTqKe09hJXXGqKLuNRXGdBNod9mn1ACujRSm80GRQ,8785
|
|
6
6
|
apify/consts.py,sha256=eSD23HmwLKwWG8bRp5O1c7bmtlhvYE17Yw46BKs4vQQ,2263
|
|
7
7
|
apify/event_manager.py,sha256=k4_f977esIOvgGshec4yUSulU10-UsEkoVEV4sZEjwg,10612
|
|
@@ -34,8 +34,8 @@ apify/storages/dataset.py,sha256=gfMlJ6dSXDdjCykkStZCyp4u8xKCIZqflGS9-jLzK74,233
|
|
|
34
34
|
apify/storages/key_value_store.py,sha256=BUGYPI4MuRlOJ_aPzZr8bq7ay_K04qAZ7yKW7C8ItV4,10760
|
|
35
35
|
apify/storages/request_queue.py,sha256=68pM2nJUYjkdpBTM315NnjRYE_yzeoslVtBQRB7bm74,28829
|
|
36
36
|
apify/storages/storage_client_manager.py,sha256=fvXg3PRojATNamEN29BBZyZZ5GWN_s0r29A59aiL-wQ,2465
|
|
37
|
-
apify-1.7.
|
|
38
|
-
apify-1.7.
|
|
39
|
-
apify-1.7.
|
|
40
|
-
apify-1.7.
|
|
41
|
-
apify-1.7.
|
|
37
|
+
apify-1.7.1b2.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
|
|
38
|
+
apify-1.7.1b2.dist-info/METADATA,sha256=kQJG_mMb2B39CARYzxbsWxKpKxPtHnq4y6D9nfkshjE,6236
|
|
39
|
+
apify-1.7.1b2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
40
|
+
apify-1.7.1b2.dist-info/top_level.txt,sha256=2oFNsHggn5m_rCaaP7xijQg_-Va2ByOSYuvKgACsS5w,6
|
|
41
|
+
apify-1.7.1b2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|