apify 2.6.1b5__py3-none-any.whl → 2.6.1b7__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
@@ -5,7 +5,7 @@ import os
5
5
  import sys
6
6
  from contextlib import suppress
7
7
  from datetime import datetime, timedelta, timezone
8
- from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar, cast, overload
8
+ from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast, overload
9
9
 
10
10
  from lazy_object_proxy import Proxy
11
11
  from more_itertools import flatten
@@ -39,6 +39,7 @@ from apify.storages import Dataset, KeyValueStore, RequestQueue
39
39
 
40
40
  if TYPE_CHECKING:
41
41
  import logging
42
+ from collections.abc import Callable
42
43
  from types import TracebackType
43
44
 
44
45
  from typing_extensions import Self
@@ -1187,7 +1188,7 @@ class _ActorType:
1187
1188
 
1188
1189
  # Check if running in Scrapy by attempting to import it.
1189
1190
  with suppress(ImportError):
1190
- import scrapy # noqa: F401
1191
+ import scrapy # noqa: F401 PLC0415
1191
1192
 
1192
1193
  self.log.debug('Running in Scrapy, setting default `exit_process` to False.')
1193
1194
  return False
apify/_charging.py CHANGED
@@ -4,7 +4,7 @@ import math
4
4
  from dataclasses import dataclass
5
5
  from datetime import datetime, timezone
6
6
  from decimal import Decimal
7
- from typing import TYPE_CHECKING, Protocol, Union
7
+ from typing import TYPE_CHECKING, Protocol
8
8
 
9
9
  from pydantic import TypeAdapter
10
10
 
@@ -23,8 +23,7 @@ if TYPE_CHECKING:
23
23
 
24
24
  from apify._configuration import Configuration
25
25
 
26
-
27
- run_validator: TypeAdapter[ActorRun | None] = TypeAdapter(Union[ActorRun, None])
26
+ run_validator = TypeAdapter[ActorRun | None](ActorRun | None)
28
27
 
29
28
 
30
29
  @docs_group('Interfaces')
@@ -216,9 +215,7 @@ class ChargingManagerImplementation(ChargingManager):
216
215
  PricingInfoItem(
217
216
  price=Decimal()
218
217
  if self._is_at_home
219
- else Decimal(
220
- '1'
221
- ), # Use a nonzero price for local development so that the maximum budget can be reached,
218
+ else Decimal(1), # Use a nonzero price for local development so that the maximum budget can be reached,
222
219
  title=f"Unknown event '{event_name}'",
223
220
  ),
224
221
  )
@@ -282,7 +279,7 @@ class ChargingManagerImplementation(ChargingManager):
282
279
  if pricing_info is not None:
283
280
  price = pricing_info.price
284
281
  elif not self._is_at_home:
285
- price = Decimal('1') # Use a nonzero price for local development so that the maximum budget can be reached
282
+ price = Decimal(1) # Use a nonzero price for local development so that the maximum budget can be reached
286
283
  else:
287
284
  price = Decimal()
288
285
 
apify/_models.py CHANGED
@@ -13,7 +13,7 @@ from crawlee._utils.urls import validate_http_url
13
13
  from apify._utils import docs_group
14
14
 
15
15
  if TYPE_CHECKING:
16
- from typing_extensions import TypeAlias
16
+ from typing import TypeAlias
17
17
 
18
18
 
19
19
  @docs_group('Data structures')
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import asyncio
4
4
  from datetime import datetime
5
- from typing import TYPE_CHECKING, Annotated, Any, Literal, Union
5
+ from typing import TYPE_CHECKING, Annotated, Any, Literal
6
6
 
7
7
  import websockets.asyncio.client
8
8
  from pydantic import BaseModel, Discriminator, Field, TypeAdapter
@@ -113,25 +113,10 @@ class UnknownEvent(BaseModel):
113
113
  data: Annotated[dict[str, Any], Field(default_factory=dict)]
114
114
 
115
115
 
116
- EventMessage = Union[
117
- PersistStateEvent,
118
- SystemInfoEvent,
119
- MigratingEvent,
120
- AbortingEvent,
121
- ExitEvent,
122
- EventWithoutData,
123
- ]
124
-
125
-
126
- event_data_adapter: TypeAdapter[EventMessage | DeprecatedEvent | UnknownEvent] = TypeAdapter(
127
- Union[
128
- Annotated[
129
- EventMessage,
130
- Discriminator('name'),
131
- ],
132
- DeprecatedEvent,
133
- UnknownEvent,
134
- ]
116
+ EventMessage = PersistStateEvent | SystemInfoEvent | MigratingEvent | AbortingEvent | ExitEvent | EventWithoutData
117
+
118
+ event_data_adapter = TypeAdapter[EventMessage | DeprecatedEvent | UnknownEvent](
119
+ Annotated[EventMessage, Discriminator('name')] | DeprecatedEvent | UnknownEvent
135
120
  )
136
121
 
137
122
 
apify/_utils.py CHANGED
@@ -3,7 +3,10 @@ from __future__ import annotations
3
3
  import builtins
4
4
  import sys
5
5
  from importlib import metadata
6
- from typing import Callable, Literal
6
+ from typing import TYPE_CHECKING, Literal
7
+
8
+ if TYPE_CHECKING:
9
+ from collections.abc import Callable
7
10
 
8
11
 
9
12
  def get_system_info() -> dict:
@@ -4,7 +4,7 @@ import asyncio
4
4
  import re
5
5
  from asyncio import Task
6
6
  from functools import partial
7
- from typing import Annotated, Any, Union
7
+ from typing import Annotated, Any
8
8
 
9
9
  from pydantic import BaseModel, Field, TypeAdapter
10
10
 
@@ -35,7 +35,7 @@ class _SimpleUrlInput(_RequestDetails):
35
35
  url: str
36
36
 
37
37
 
38
- url_input_adapter = TypeAdapter(list[Union[_RequestsFromUrlInput, _SimpleUrlInput]])
38
+ url_input_adapter = TypeAdapter(list[_RequestsFromUrlInput | _SimpleUrlInput])
39
39
 
40
40
 
41
41
  @docs_group('Classes')
@@ -1,13 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apify
3
- Version: 2.6.1b5
3
+ Version: 2.6.1b7
4
4
  Summary: Apify SDK for Python
5
- Project-URL: Homepage, https://docs.apify.com/sdk/python/
6
- Project-URL: Apify homepage, https://apify.com
5
+ Project-URL: Apify Homepage, https://apify.com
7
6
  Project-URL: Changelog, https://docs.apify.com/sdk/python/docs/changelog
8
- Project-URL: Documentation, https://docs.apify.com/sdk/python/
9
- Project-URL: Issue tracker, https://github.com/apify/apify-sdk-python/issues
10
- Project-URL: Repository, https://github.com/apify/apify-sdk-python
7
+ Project-URL: Discord, https://discord.com/invite/jyEM2PRvMU
8
+ Project-URL: Documentation, https://docs.apify.com/sdk/python/docs/overview/introduction
9
+ Project-URL: Homepage, https://docs.apify.com/sdk/python/
10
+ Project-URL: Issue Tracker, https://github.com/apify/apify-sdk-python/issues
11
+ Project-URL: Release Notes, https://docs.apify.com/sdk/python/docs/upgrading/upgrading-to-v2
12
+ Project-URL: Source Code, https://github.com/apify/apify-sdk-python
11
13
  Author-email: "Apify Technologies s.r.o." <support@apify.com>
12
14
  License: Apache License
13
15
  Version 2.0, January 2004
@@ -213,16 +215,16 @@ License: Apache License
213
215
  License-File: LICENSE
214
216
  Keywords: apify,automation,chrome,crawlee,crawler,headless,scraper,scraping,sdk
215
217
  Classifier: Development Status :: 5 - Production/Stable
218
+ Classifier: Environment :: Console
216
219
  Classifier: Intended Audience :: Developers
217
220
  Classifier: License :: OSI Approved :: Apache Software License
218
221
  Classifier: Operating System :: OS Independent
219
- Classifier: Programming Language :: Python :: 3.9
220
222
  Classifier: Programming Language :: Python :: 3.10
221
223
  Classifier: Programming Language :: Python :: 3.11
222
224
  Classifier: Programming Language :: Python :: 3.12
223
225
  Classifier: Programming Language :: Python :: 3.13
224
226
  Classifier: Topic :: Software Development :: Libraries
225
- Requires-Python: >=3.9
227
+ Requires-Python: >=3.10
226
228
  Requires-Dist: apify-client>=1.11.0
227
229
  Requires-Dist: apify-shared>=1.3.0
228
230
  Requires-Dist: crawlee~=0.6.0
@@ -1,13 +1,13 @@
1
1
  apify/__init__.py,sha256=HpgKg2FZWJuSPfDygzJ62psylhw4NN4tKFnoYUIhcd4,838
2
- apify/_actor.py,sha256=upAtTASPqzzBNkypqir750IrbwhP0_JZl-SsMXvc94k,51874
3
- apify/_charging.py,sha256=m7hJIQde4M7vS4g_4hsNRP5xHNXjYQ8MyqOEGeNb7VY,12267
2
+ apify/_actor.py,sha256=KB8dwoFzTMdEBDcjcHDeEuYH6EXYspqni4Pp-CvHV_o,51913
3
+ apify/_charging.py,sha256=QysDbvJS25ZVefRTXMyqrSvK5yAh729T-mDOraHBac8,12198
4
4
  apify/_configuration.py,sha256=AVztnlaBkHxBs0VkLIUhFHWwvlgHY-koMNUc0aqw9ZI,11908
5
5
  apify/_consts.py,sha256=_Xq4hOfOA1iZ3n1P967YWdyncKivpbX6RTlp_qanUoE,330
6
6
  apify/_crypto.py,sha256=8BgeQC0ZhYP5KdmLxxLQAW87Gq-Z4HlREbYGXr46w0U,6607
7
- apify/_models.py,sha256=-Y0rljBJWxMMCp8iDCTG4UV3bEvNZzp-kx2SYbPfeIY,7919
8
- apify/_platform_event_manager.py,sha256=igi9dRTfB7t0mRBM1bCfzMh7RBbr5adrJ0iRymUQ8S8,7990
7
+ apify/_models.py,sha256=q2P7q95QOOzjnm3yQV8c1FyLUCtmUQkQXwnnvQK1s9A,7908
8
+ apify/_platform_event_manager.py,sha256=fuI7C-TR8PcHA0yQO7mCoMQWIpr7zmLHA038quSv0Qk,7869
9
9
  apify/_proxy_configuration.py,sha256=eMeYr9mr2ITURBmgZw4Cel9kfkiLhdaxE47EDh-3okM,13091
10
- apify/_utils.py,sha256=7YL7VhmNND0XARsXtPQWWQCyK4825n-ZVB8n9cgWm0A,1838
10
+ apify/_utils.py,sha256=edPePMDorJcppZAT4XyWFRzRPloZ1OjLG4WYzGeVpBY,1903
11
11
  apify/log.py,sha256=j-E4t-WeA93bc1NCQRG8sTntehQCiiN8ia-MdQe3_Ts,1291
12
12
  apify/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  apify/apify_storage_client/__init__.py,sha256=-UbR68bFsDR6ln8OFs4t50eqcnY36hujO-SeOt-KmcA,114
@@ -36,9 +36,9 @@ apify/scrapy/pipelines/__init__.py,sha256=GWPeLN_Zwj8vRBWtXW6DaxdB7mvyQ7Jw5Tz1cc
36
36
  apify/scrapy/pipelines/actor_dataset_push.py,sha256=XUUyznQTD-E3wYUUFt2WAOnWhbnRrY0WuedlfYfYhDI,846
37
37
  apify/scrapy/pipelines/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  apify/storages/__init__.py,sha256=FW-z6ubuPnHGM-Wp15T8mR5q6lnpDGrCW-IkgZd5L30,177
39
- apify/storages/_request_list.py,sha256=FCC4X2MX2V8vLZBCUi5Q1qg9w62y9UkF4ptOqyPVhG8,6052
39
+ apify/storages/_request_list.py,sha256=vTcd6eU6c_9XRf6NrQFz41ndXPXO5KEKf9Hn9DjwaMk,6039
40
40
  apify/storages/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- apify-2.6.1b5.dist-info/METADATA,sha256=a6ZzWfqK_6xZgz0yj4zcLV88ZUdgUBJanDOYiOuVn1o,21558
42
- apify-2.6.1b5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
- apify-2.6.1b5.dist-info/licenses/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
44
- apify-2.6.1b5.dist-info/RECORD,,
41
+ apify-2.6.1b7.dist-info/METADATA,sha256=RjE8a-1i96cXqc14piFJCPUb-6qXYvL6KVBJLafK9o8,21724
42
+ apify-2.6.1b7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
+ apify-2.6.1b7.dist-info/licenses/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
44
+ apify-2.6.1b7.dist-info/RECORD,,