scalable-pypeline 2.0.4__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__ = "2.0.4"
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.
@@ -135,7 +135,7 @@ class PipelineInvoke(MethodView):
135
135
  tags=["Pipelines"],
136
136
  )
137
137
  @bp.arguments(InvokePipelineSchema)
138
- @bp.response(InvokePipelineResponseSchema)
138
+ @bp.response(200, InvokePipelineResponseSchema)
139
139
  def post(self, payload: dict, pipeline_id: str):
140
140
  """Invoke a pipeline by it's ID; optionally provide pipeline arguments."""
141
141
  pipeline_config = retrieve_latest_pipeline_config(pipeline_id=pipeline_id)
@@ -191,7 +191,7 @@ class PipelineResults(MethodView):
191
191
  ],
192
192
  tags=["Pipelines"],
193
193
  )
194
- @bp.response(GetPipelineResultResponseSchema)
194
+ @bp.response(200, GetPipelineResultResponseSchema)
195
195
  def get(self, execution_id: str):
196
196
  """Retrieve results of a pipeline's execution based on execution_id
197
197
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scalable-pypeline
3
- Version: 2.0.4
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
@@ -8,8 +8,6 @@ License: Apache License 2.0
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
10
  Requires-Dist: PyYAML (<7,>=6.0.1)
11
- Requires-Dist: click (==8.0.4)
12
- Requires-Dist: marshmallow (<4,>=3.2.1)
13
11
  Requires-Dist: redis (<5,>=4.5.4)
14
12
  Requires-Dist: db-medley[redis] (<2,>=1.0.2)
15
13
  Requires-Dist: croniter (<2,>=1.0.15)
@@ -17,18 +15,15 @@ Provides-Extra: build
17
15
  Requires-Dist: wheel ; extra == 'build'
18
16
  Requires-Dist: twine ; extra == 'build'
19
17
  Provides-Extra: dev
20
- Requires-Dist: blackd ; extra == 'dev'
18
+ Requires-Dist: black ; extra == 'dev'
21
19
  Provides-Extra: flask
22
- Requires-Dist: Werkzeug (==2.0.3) ; extra == 'flask'
23
- Requires-Dist: itsdangerous (==2.0.1) ; extra == 'flask'
24
- Requires-Dist: Flask (<2,>=1.1.2) ; extra == 'flask'
25
- Requires-Dist: flask-smorest (<0.29,>=0.23.0) ; extra == 'flask'
26
- Requires-Dist: Jinja2 (==3.0.3) ; extra == 'flask'
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'
27
23
  Provides-Extra: test
28
24
  Requires-Dist: pytest-cov (<3,>=2.6.1) ; extra == 'test'
29
25
  Requires-Dist: tox (<4,>=3.14.1) ; extra == 'test'
30
26
  Requires-Dist: mock (<2,>=1) ; extra == 'test'
31
- Requires-Dist: moto (<4,>=1.3.16) ; extra == 'test'
32
27
  Requires-Dist: responses (<0.11,>=0.10.16) ; extra == 'test'
33
28
  Requires-Dist: fakeredis (<3,>=2.10.3) ; extra == 'test'
34
29
  Requires-Dist: importlib-metadata (<5,>=4.12) ; extra == 'test'
@@ -1,8 +1,8 @@
1
- pypeline/__init__.py,sha256=ZOg41aCgKEuObK5WhegikXektFWPJaeZ-TMDh0Ke95M,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
@@ -12,16 +12,16 @@ pypeline/flask/__init__.py,sha256=AdljRh0lMiS8ExgDmgzObwVs8jW7hqQuf83Ml8kn8GQ,49
12
12
  pypeline/flask/decorators.py,sha256=ki6jkjZwbDbCWuj7ET7N-ncZwrASp4Fy7257WIYiAAQ,1102
13
13
  pypeline/flask/flask_pypeline.py,sha256=Uqyu3PnSP3DoVZUJPqV9chjT4xdRgvcL3OMXxkbdTEg,5490
14
14
  pypeline/flask/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- pypeline/flask/api/pipelines.py,sha256=sPvEoNwmnJPSA96lZHYS2fwKqZlVyE2OSjUmOPFi91o,7267
15
+ pypeline/flask/api/pipelines.py,sha256=Hne41W0VSmHuiDBE9YwpTt9dUZsTb8ew9U9dKoB85bs,7277
16
16
  pypeline/flask/api/schedules.py,sha256=31lwoFlGv-S-2ahGUCnD5YbmKws8yddj6_PEzzdBi9s,1321
17
17
  pypeline/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  pypeline/utils/config_utils.py,sha256=rAIATyoW7kGETZ_Z2DqiXtGd7bJp5uPfcLtfNPOYsNs,2167
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-2.0.4.dist-info/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
23
- scalable_pypeline-2.0.4.dist-info/METADATA,sha256=7x7ixgNRG6TzxBmPNoccefVAwRKuESR_eoyIoJ6oHTw,6239
24
- scalable_pypeline-2.0.4.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
25
- scalable_pypeline-2.0.4.dist-info/entry_points.txt,sha256=uWs10ODfHSBKo2Cx_QaUjPHQTpZ3e77j9VlAdRRmMyg,119
26
- scalable_pypeline-2.0.4.dist-info/top_level.txt,sha256=C7dpkEOc_-nnsAQb28BfQknjD6XHRyS9ZrvVeoIbV7s,15
27
- scalable_pypeline-2.0.4.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,,