scalable-pypeline 2.0.4__tar.gz → 3.0.1__tar.gz

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.
Files changed (35) hide show
  1. {scalable-pypeline-2.0.4/scalable_pypeline.egg-info → scalable-pypeline-3.0.1}/PKG-INFO +1 -1
  2. scalable-pypeline-3.0.1/pypeline/__init__.py +1 -0
  3. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/constants.py +6 -0
  4. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/dramatiq.py +20 -6
  5. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/flask/api/pipelines.py +2 -2
  6. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/requirements.txt +0 -2
  7. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1/scalable_pypeline.egg-info}/PKG-INFO +1 -1
  8. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/scalable_pypeline.egg-info/requires.txt +4 -9
  9. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/setup.py +4 -7
  10. scalable-pypeline-2.0.4/pypeline/__init__.py +0 -1
  11. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/LICENSE +0 -0
  12. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/MANIFEST.in +0 -0
  13. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/README.md +0 -0
  14. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/barrier.py +0 -0
  15. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/composition.py +0 -0
  16. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/extensions.py +0 -0
  17. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/flask/__init__.py +0 -0
  18. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/flask/api/__init__.py +0 -0
  19. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/flask/api/schedules.py +0 -0
  20. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/flask/decorators.py +0 -0
  21. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/flask/flask_pypeline.py +0 -0
  22. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/middleware.py +0 -0
  23. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/pipeline_config_schema.py +0 -0
  24. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/pypeline_yaml.py +0 -0
  25. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/schedule_config_schema.py +0 -0
  26. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/utils/__init__.py +0 -0
  27. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/utils/config_utils.py +0 -0
  28. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/utils/module_utils.py +0 -0
  29. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/pypeline/utils/pipeline_utils.py +0 -0
  30. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/scalable_pypeline.egg-info/SOURCES.txt +0 -0
  31. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/scalable_pypeline.egg-info/dependency_links.txt +0 -0
  32. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/scalable_pypeline.egg-info/entry_points.txt +0 -0
  33. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/scalable_pypeline.egg-info/top_level.txt +0 -0
  34. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/setup.cfg +0 -0
  35. {scalable-pypeline-2.0.4 → scalable-pypeline-3.0.1}/tests/fixtures/__init__.py +0 -0
@@ -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
@@ -0,0 +1 @@
1
+ __version__ = "3.0.1"
@@ -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
@@ -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,4 @@
1
1
  PyYAML>=6.0.1,<7
2
- click==8.0.4
3
- marshmallow>=3.2.1,<4
4
2
  redis>=4.5.4,<5
5
3
  db-medley[redis]>=1.0.2,<2
6
4
  croniter>=1.0.15,<2
@@ -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
@@ -1,6 +1,4 @@
1
1
  PyYAML<7,>=6.0.1
2
- click==8.0.4
3
- marshmallow<4,>=3.2.1
4
2
  redis<5,>=4.5.4
5
3
  db-medley[redis]<2,>=1.0.2
6
4
  croniter<2,>=1.0.15
@@ -10,20 +8,17 @@ wheel
10
8
  twine
11
9
 
12
10
  [dev]
13
- blackd
11
+ black
14
12
 
15
13
  [flask]
16
- Werkzeug==2.0.3
17
- itsdangerous==2.0.1
18
- Flask<2,>=1.1.2
19
- flask-smorest<0.29,>=0.23.0
20
- Jinja2==3.0.3
14
+ flask-smorest<0.45,>=0.44.0
15
+ werkzeug<4,>=3.0.1
16
+ flask<4,>=3.0.2
21
17
 
22
18
  [test]
23
19
  pytest-cov<3,>=2.6.1
24
20
  tox<4,>=3.14.1
25
21
  mock<2,>=1
26
- moto<4,>=1.3.16
27
22
  responses<0.11,>=0.10.16
28
23
  fakeredis<3,>=2.10.3
29
24
  importlib-metadata<5,>=4.12
@@ -174,11 +174,9 @@ setup(
174
174
  extras_require={
175
175
  "build": ["wheel", "twine"],
176
176
  "flask": [
177
- "Werkzeug==2.0.3",
178
- "itsdangerous==2.0.1",
179
- "Flask>=1.1.2,<2",
180
- "flask-smorest>=0.23.0,<0.29",
181
- "Jinja2==3.0.3",
177
+ "flask-smorest>=0.44.0,<0.45",
178
+ "werkzeug>=3.0.1,<4",
179
+ "flask>=3.0.2,<4",
182
180
  ],
183
181
  "web": ["gunicorn", "gevent>=21.12.0,<22"],
184
182
  "workers": [
@@ -186,12 +184,11 @@ setup(
186
184
  "dramatiq[rabbitmq]>=1.17.0,<2",
187
185
  "apscheduler>=3.10.4,<4",
188
186
  ],
189
- "dev": ["blackd"],
187
+ "dev": ["black"],
190
188
  "test": [
191
189
  "pytest-cov>=2.6.1,<3",
192
190
  "tox>=3.14.1,<4",
193
191
  "mock>=1,<2",
194
- "moto>=1.3.16,<4",
195
192
  "responses>=0.10.16,<0.11",
196
193
  "fakeredis>=2.10.3,<3",
197
194
  "importlib-metadata>=4.12,<5",
@@ -1 +0,0 @@
1
- __version__ = "2.0.4"