scalable-pypeline 3.0.0__py2.py3-none-any.whl → 3.0.1__py2.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.
pypeline/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "3.0.0"
1
+ __version__ = "3.0.1"
pypeline/constants.py CHANGED
@@ -1,5 +1,6 @@
1
1
  """ Pypeline Constants
2
2
  """
3
+
3
4
  import os
4
5
 
5
6
  # Pypeline configuration defaults
@@ -26,6 +27,11 @@ DEFAULT_TASK_MIN_BACKOFF = int(os.getenv("DEFAULT_TASK_MIN_BACKOFF", 15)) # sec
26
27
  DEFAULT_TASK_MAX_BACKOFF = int(
27
28
  os.getenv("DEFAULT_TASK_MAX_BACKOFF", 3600)
28
29
  ) # seconds (1 hour)
30
+ DEFAULT_BROKER_HEARTBEAT = int(os.getenv("DEFAULT_BROKER_HEARTBEAT", 5))
31
+ DEFAULT_CONNECTION_ATTEMPTS = int(os.getenv("DEFAULT_CONNECTION_ATTEMPTS", 5))
32
+ DEFAULT_BLOCKED_CONNECTION_TIMEOUT = int(
33
+ os.getenv("DEFAULT_BLOCKED_CONNECTION_TIMEOUT", 30)
34
+ )
29
35
 
30
36
 
31
37
  MS_IN_SECONDS = 1000
pypeline/dramatiq.py CHANGED
@@ -1,15 +1,15 @@
1
1
  import importlib
2
+ import logging
2
3
  import os.path
3
4
  import sys
4
5
  import typing
5
- import logging
6
- import click
7
- from pypeline.extensions import pypeline_config
8
- from warnings import warn
9
6
  from functools import wraps
7
+ from typing import Awaitable, Callable, Optional, Union, TYPE_CHECKING, TypeVar
8
+ from warnings import warn
9
+
10
+ import click
10
11
  from apscheduler.schedulers.blocking import BlockingScheduler
11
12
  from apscheduler.triggers.cron import CronTrigger
12
- from typing import Awaitable, Callable, Optional, Union, TYPE_CHECKING, TypeVar
13
13
  from dramatiq import Broker, Middleware, actor as register_actor, set_broker, get_broker
14
14
  from dramatiq.brokers.rabbitmq import RabbitmqBroker
15
15
  from dramatiq.cli import (
@@ -35,7 +35,11 @@ from pypeline.constants import (
35
35
  DEFAULT_TASK_MAX_RETRY,
36
36
  DEFAULT_TASK_MIN_BACKOFF,
37
37
  DEFAULT_TASK_MAX_BACKOFF,
38
+ DEFAULT_BROKER_HEARTBEAT,
39
+ DEFAULT_CONNECTION_ATTEMPTS,
40
+ DEFAULT_BLOCKED_CONNECTION_TIMEOUT,
38
41
  )
42
+ from pypeline.extensions import pypeline_config
39
43
  from pypeline.middleware import ParallelPipeline
40
44
  from pypeline.utils.config_utils import (
41
45
  retrieve_latest_schedule_config,
@@ -56,7 +60,16 @@ logger = logging.getLogger(__name__)
56
60
 
57
61
  def configure_default_broker(broker: Broker = None):
58
62
  redis_backend = RedisBackend(url=REDIS_URL)
59
- rabbit_broker = broker if broker is not None else RabbitmqBroker(url=RABBIT_URL)
63
+ rabbit_broker = (
64
+ broker
65
+ if broker is not None
66
+ else RabbitmqBroker(
67
+ url=RABBIT_URL,
68
+ heartbeat=DEFAULT_BROKER_HEARTBEAT,
69
+ connection_attempts=DEFAULT_CONNECTION_ATTEMPTS,
70
+ blocked_connection_timeout=DEFAULT_BLOCKED_CONNECTION_TIMEOUT,
71
+ )
72
+ )
60
73
  rabbit_broker.add_middleware(Results(backend=redis_backend))
61
74
  rabbit_broker.add_middleware(ParallelPipeline(redis_url=REDIS_URL))
62
75
  rabbit_broker.add_middleware(CurrentMessage())
@@ -257,6 +270,7 @@ class Dramatiq:
257
270
  :param kw: Keywords argument passed to :func:`dramatiq.actor`.
258
271
 
259
272
  """
273
+
260
274
  # Substitute dramatiq.actor decorator to return a lazy wrapper. This
261
275
  # allows to register actors in extension before the broker is
262
276
  # effectively configured by init_app.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scalable-pypeline
3
- Version: 3.0.0
3
+ Version: 3.0.1
4
4
  Summary: PypeLine - Python pipelines for the Real World
5
5
  Home-page: https://gitlab.com/bravos2/pypeline
6
6
  Author: Bravos Power Corporation
@@ -15,14 +15,15 @@ Provides-Extra: build
15
15
  Requires-Dist: wheel ; extra == 'build'
16
16
  Requires-Dist: twine ; extra == 'build'
17
17
  Provides-Extra: dev
18
- Requires-Dist: blackd ; extra == 'dev'
18
+ Requires-Dist: black ; extra == 'dev'
19
19
  Provides-Extra: flask
20
20
  Requires-Dist: flask-smorest (<0.45,>=0.44.0) ; extra == 'flask'
21
+ Requires-Dist: werkzeug (<4,>=3.0.1) ; extra == 'flask'
22
+ Requires-Dist: flask (<4,>=3.0.2) ; extra == 'flask'
21
23
  Provides-Extra: test
22
24
  Requires-Dist: pytest-cov (<3,>=2.6.1) ; extra == 'test'
23
25
  Requires-Dist: tox (<4,>=3.14.1) ; extra == 'test'
24
26
  Requires-Dist: mock (<2,>=1) ; extra == 'test'
25
- Requires-Dist: moto (<4,>=1.3.16) ; extra == 'test'
26
27
  Requires-Dist: responses (<0.11,>=0.10.16) ; extra == 'test'
27
28
  Requires-Dist: fakeredis (<3,>=2.10.3) ; extra == 'test'
28
29
  Requires-Dist: importlib-metadata (<5,>=4.12) ; extra == 'test'
@@ -1,8 +1,8 @@
1
- pypeline/__init__.py,sha256=EPmgXOdWKks5S__ZMH7Nu6xpAeVrZpfxaFy4pykuyeI,22
1
+ pypeline/__init__.py,sha256=E3P6AbnCwaWk6ndR1zNqlOTVebX9z5rv9voltc71dos,22
2
2
  pypeline/barrier.py,sha256=dLDaprH5NB-C7MQjZqPpBBhMjmO0VV_kTonlgweznHc,1096
3
3
  pypeline/composition.py,sha256=pTw9Xb9h4JnV4siFc3JStm5lB-i9djUADo3Kh5K3s7g,12976
4
- pypeline/constants.py,sha256=vi4UZz1xd0ZeIuelp4QgCQsMlIHW65-lVB8l_iA8kBE,2578
5
- pypeline/dramatiq.py,sha256=vO79DHqLldh5mqQf6-okn6gjFWxYU_bGdkMvTyV9Qmc,14942
4
+ pypeline/constants.py,sha256=8qsH44Hal9K5fNYFXy7v8o-Qw8VUb-l8khC0kvkvMF8,2831
5
+ pypeline/dramatiq.py,sha256=Xtu1U3ALmPTEVsit3gfIUwA5rB_DxXQ40t6Nd83WIXM,15286
6
6
  pypeline/extensions.py,sha256=BzOTnXhNxap3N7uIUUh_hO6dDwx08Vc_RJDE93_K0Lo,610
7
7
  pypeline/middleware.py,sha256=kTp6niYoe2nXIiN6EGRfdpxrJyioo0GPxDkfefbGlEk,2821
8
8
  pypeline/pipeline_config_schema.py,sha256=DQ_RMucnA0AyrndlW6lkb0orGromcO6C9GgLHyG6lJ0,8013
@@ -19,9 +19,9 @@ pypeline/utils/config_utils.py,sha256=rAIATyoW7kGETZ_Z2DqiXtGd7bJp5uPfcLtfNPOYsN
19
19
  pypeline/utils/module_utils.py,sha256=boEP9IYr4p_ick7HlVUfIxOYHQlEmo7dgvDBCQc-C28,2914
20
20
  pypeline/utils/pipeline_utils.py,sha256=tt71hLEFgPieokJZlC1rP2dmCTctrOPt7K1rGlbnT4o,5967
21
21
  tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- scalable_pypeline-3.0.0.dist-info/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
23
- scalable_pypeline-3.0.0.dist-info/METADATA,sha256=rRgk8isNwrBWH4qXZ3pmtN6SlJm_-MhdQF78LPWRf60,5954
24
- scalable_pypeline-3.0.0.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
25
- scalable_pypeline-3.0.0.dist-info/entry_points.txt,sha256=uWs10ODfHSBKo2Cx_QaUjPHQTpZ3e77j9VlAdRRmMyg,119
26
- scalable_pypeline-3.0.0.dist-info/top_level.txt,sha256=C7dpkEOc_-nnsAQb28BfQknjD6XHRyS9ZrvVeoIbV7s,15
27
- scalable_pypeline-3.0.0.dist-info/RECORD,,
22
+ scalable_pypeline-3.0.1.dist-info/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
23
+ scalable_pypeline-3.0.1.dist-info/METADATA,sha256=GD0SiI3YiHYCdYqyYtgwOVgwTaOpC4ZlVuKgFTfkBqE,6010
24
+ scalable_pypeline-3.0.1.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
25
+ scalable_pypeline-3.0.1.dist-info/entry_points.txt,sha256=uWs10ODfHSBKo2Cx_QaUjPHQTpZ3e77j9VlAdRRmMyg,119
26
+ scalable_pypeline-3.0.1.dist-info/top_level.txt,sha256=C7dpkEOc_-nnsAQb28BfQknjD6XHRyS9ZrvVeoIbV7s,15
27
+ scalable_pypeline-3.0.1.dist-info/RECORD,,