apify 2.1.0__py3-none-any.whl → 2.1.0b2__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/__init__.py CHANGED
@@ -13,8 +13,8 @@ __version__ = metadata.version('apify')
13
13
 
14
14
  __all__ = [
15
15
  'Actor',
16
- 'Configuration',
17
16
  'Event',
17
+ 'Configuration',
18
18
  'ProxyConfiguration',
19
19
  'ProxyInfo',
20
20
  'Request',
apify/_configuration.py CHANGED
@@ -323,4 +323,4 @@ class Configuration(CrawleeConfiguration):
323
323
 
324
324
 
325
325
  # Monkey-patch the base class so that it works with the extended configuration
326
- CrawleeConfiguration.get_global_configuration = Configuration.get_global_configuration # type: ignore[method-assign]
326
+ CrawleeConfiguration.get_global_configuration = Configuration.get_global_configuration # type: ignore
@@ -280,7 +280,7 @@ class ProxyConfiguration(CrawleeProxyConfiguration):
280
280
  return
281
281
 
282
282
  status = None
283
- async with httpx.AsyncClient(proxy=proxy_info.url, timeout=10) as client:
283
+ async with httpx.AsyncClient(proxies=proxy_info.url, timeout=10) as client:
284
284
  for _ in range(2):
285
285
  try:
286
286
  response = await client.get(proxy_status_url)
apify/scrapy/__init__.py CHANGED
@@ -3,9 +3,9 @@ from apify.scrapy.scheduler import ApifyScheduler
3
3
  from apify.scrapy.utils import get_basic_auth_header, get_running_event_loop_id
4
4
 
5
5
  __all__ = [
6
+ 'to_apify_request',
7
+ 'to_scrapy_request',
6
8
  'ApifyScheduler',
7
9
  'get_basic_auth_header',
8
10
  'get_running_event_loop_id',
9
- 'to_apify_request',
10
- 'to_scrapy_request',
11
11
  ]
apify/scrapy/requests.py CHANGED
@@ -42,10 +42,8 @@ def to_apify_request(scrapy_request: Request, spider: Spider) -> CrawleeRequest
42
42
  Returns:
43
43
  The converted Apify request if the conversion was successful, otherwise None.
44
44
  """
45
- if not isinstance(scrapy_request, Request):
46
- Actor.log.warning( # type: ignore[unreachable]
47
- 'Failed to convert to Apify request: Scrapy request must be a Request instance.'
48
- )
45
+ if not isinstance(cast(Any, scrapy_request), Request):
46
+ Actor.log.warning('Failed to convert to Apify request: Scrapy request must be a Request instance.')
49
47
  return None
50
48
 
51
49
  call_id = crypto_random_object_id(8)
@@ -55,7 +53,7 @@ def to_apify_request(scrapy_request: Request, spider: Spider) -> CrawleeRequest
55
53
  if _is_request_produced_by_middleware(scrapy_request):
56
54
  unique_key = compute_unique_key(
57
55
  url=scrapy_request.url,
58
- method=scrapy_request.method, # type: ignore[arg-type] # str vs literal
56
+ method=scrapy_request.method,
59
57
  payload=scrapy_request.body,
60
58
  use_extended_unique_key=True,
61
59
  )
@@ -82,9 +80,9 @@ def to_apify_request(scrapy_request: Request, spider: Spider) -> CrawleeRequest
82
80
 
83
81
  # Convert Scrapy's headers to a HttpHeaders and store them in the apify_request
84
82
  if isinstance(scrapy_request.headers, Headers):
85
- apify_request.headers = HttpHeaders(dict(scrapy_request.headers.to_unicode_dict()))
83
+ apify_request.headers = HttpHeaders(scrapy_request.headers.to_unicode_dict())
86
84
  else:
87
- Actor.log.warning( # type: ignore[unreachable]
85
+ Actor.log.warning(
88
86
  f'Invalid scrapy_request.headers type, not scrapy.http.headers.Headers: {scrapy_request.headers}'
89
87
  )
90
88
 
@@ -2,4 +2,4 @@ from crawlee.storages import Dataset, KeyValueStore, RequestQueue
2
2
 
3
3
  from ._request_list import RequestList
4
4
 
5
- __all__ = ['Dataset', 'KeyValueStore', 'RequestList', 'RequestQueue']
5
+ __all__ = ['Dataset', 'KeyValueStore', 'RequestQueue', 'RequestList']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apify
3
- Version: 2.1.0
3
+ Version: 2.1.0b2
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
@@ -21,9 +21,9 @@ Classifier: Topic :: Software Development :: Libraries
21
21
  Provides-Extra: scrapy
22
22
  Requires-Dist: apify-client (>=1.8.1)
23
23
  Requires-Dist: apify-shared (>=1.1.2)
24
- Requires-Dist: crawlee (>=0.4.0,<0.5.0)
24
+ Requires-Dist: crawlee (>=0.3.9)
25
25
  Requires-Dist: cryptography (>=42.0.0)
26
- Requires-Dist: httpx (>=0.27.0,<0.28.0)
26
+ Requires-Dist: httpx (>=0.27.0)
27
27
  Requires-Dist: lazy-object-proxy (>=1.10.0)
28
28
  Requires-Dist: scrapy (>=2.11.0) ; extra == "scrapy"
29
29
  Requires-Dist: typing-extensions (>=4.1.0)
@@ -1,11 +1,11 @@
1
- apify/__init__.py,sha256=99ynaDWBLEcCjdLq7R0Exy_iACsXiXoQ8VUZKmbzTeM,550
1
+ apify/__init__.py,sha256=ikoi2EpDYl6y-XSVtlU8UsdQdMEyOiIJCRRAaZFDOP8,550
2
2
  apify/_actor.py,sha256=AUviY4qrX4UoN7fSZtXXSHqEk4rrQwBymMLjkgb4Mzg,41887
3
- apify/_configuration.py,sha256=WC9X5gQ-e5r4BGQw-Kaq77oxLlPx7vtq0M-L4VlKrIc,9633
3
+ apify/_configuration.py,sha256=mzxBrz9eocZiGcCWuDV3YYyKGd_3-A4hMu63qRN8Ep4,9618
4
4
  apify/_consts.py,sha256=_Xq4hOfOA1iZ3n1P967YWdyncKivpbX6RTlp_qanUoE,330
5
5
  apify/_crypto.py,sha256=e0_aM3l9_5Osk-jszYOOjrAKK60OggSHbiw5c30QnsU,5638
6
6
  apify/_models.py,sha256=Btlz-23obKY5tJ75JnUwkVNC2lmU1IEBbdU3HvWaVhg,5748
7
7
  apify/_platform_event_manager.py,sha256=44xyV0Lpzf4h4VZ0rkyYg_nhbQkEONNor8_Z9gIKO40,7899
8
- apify/_proxy_configuration.py,sha256=vdDiE5dfyNQYEXKXnj0jcgL3rG3-qanwNSybrVl1xT8,13167
8
+ apify/_proxy_configuration.py,sha256=-QaBrO5FmEy78Ylrry15VgBdu3Jpkz4oHAlCD5-9MBk,13169
9
9
  apify/_utils.py,sha256=CCLkpAsZKp00ykm88Z_Fbck5PNT0j6mJYOuD0RxzZUs,1620
10
10
  apify/apify_storage_client/__init__.py,sha256=-UbR68bFsDR6ln8OFs4t50eqcnY36hujO-SeOt-KmcA,114
11
11
  apify/apify_storage_client/_apify_storage_client.py,sha256=NsZBleJNHLBXVyG__bVjdCGEI30cnmVZngCbQaVekfk,2397
@@ -18,7 +18,7 @@ apify/apify_storage_client/_request_queue_collection_client.py,sha256=NnO73UJ9Zr
18
18
  apify/apify_storage_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  apify/log.py,sha256=zElFyEp2RJN0kiHEwJhcjSCAuHrba5zYiq4pK2xsL_o,1450
20
20
  apify/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- apify/scrapy/__init__.py,sha256=HE5wCN7-DZKPydLCOvjNyLuL3CvN2fUFweXfrDfe1Ss,348
21
+ apify/scrapy/__init__.py,sha256=qDPV_zTRFaUqoFOyS5g4uBfz-UCkmWYJ82VXQ_3Cw6k,348
22
22
  apify/scrapy/middlewares/__init__.py,sha256=tfW-d3WFWLeNEjL8fTmon6NwgD-OXx1Bw2fBdU-wPy4,114
23
23
  apify/scrapy/middlewares/apify_proxy.py,sha256=9_-hJqTwQ4yVMjvN9zkJ_GXJADzrrYu8QoHZ6IX6fDs,5764
24
24
  apify/scrapy/middlewares/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -26,13 +26,13 @@ apify/scrapy/pipelines/__init__.py,sha256=GWPeLN_Zwj8vRBWtXW6DaxdB7mvyQ7Jw5Tz1cc
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
- apify/scrapy/requests.py,sha256=yZ9hIsz2YyqOoOwzN9F1h76wG4qwawrI6h_6xq0I7Iw,7599
29
+ apify/scrapy/requests.py,sha256=F4VNaX2fGqybJKbhcRcz0_m6dXse5LzKll4gtMuTRko,7480
30
30
  apify/scrapy/scheduler.py,sha256=03kZxejWWb-TofJ-vpSZuQ28rT-qNjhhpC-QeO2OzoU,5977
31
31
  apify/scrapy/utils.py,sha256=758DcHCSAgCTProY0QX74uJ1XrzVsQwvCmFanj2f_3Q,2928
32
- apify/storages/__init__.py,sha256=FW-z6ubuPnHGM-Wp15T8mR5q6lnpDGrCW-IkgZd5L30,177
32
+ apify/storages/__init__.py,sha256=AE4ZJ-iAoESmQQh_RUU78fe5CxBUnu9wlEZleQc5SwA,177
33
33
  apify/storages/_request_list.py,sha256=4nrvSdMUF-kiwGVIPEfIOygLKgjUpO37Jl8Om-jRbIU,5858
34
34
  apify/storages/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- apify-2.1.0.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
36
- apify-2.1.0.dist-info/METADATA,sha256=9K6Q_mrUCisKOlhMQuvt74xYMcaxu6UZPLMtec_8Pnc,8678
37
- apify-2.1.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
38
- apify-2.1.0.dist-info/RECORD,,
35
+ apify-2.1.0b2.dist-info/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
36
+ apify-2.1.0b2.dist-info/METADATA,sha256=YSc5d6kH4W49HvGyvTSalEFC6TYGqFJIwyL2oF5TV0o,8665
37
+ apify-2.1.0b2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
38
+ apify-2.1.0b2.dist-info/RECORD,,
File without changes