Skip to content

StandalonePipeline has dependency on redis #89

@ARMmaster17

Description

@ARMmaster17

Describe the bug
In a project where only the StandalonePipeline is being used, there is a dependency on the redis package through pipelines/__init__.py.

To Reproduce
Steps to reproduce the behavior:

  1. Create a blank Python project.
  2. Add only watergrid==1.1.0 to requirements.txt and install from pip.
  3. Create a StandalonePipeline, using the import line from watergrid.pipelines import StandalonePipeline.
  4. Run the project and note the below error:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/<project_path>/test/TestExtractLogsStep.py", line 4, in <module>
    from watergrid.pipelines import StandalonePipeline
  File "/<project_path>/venv/lib/python3.9/site-packages/watergrid/pipelines/__init__.py", line 1, in <module>
    from watergrid.pipelines.ha_pipeline import HAPipeline
  File "/<project_path>/venv/lib/python3.9/site-packages/watergrid/pipelines/ha_pipeline.py", line 4, in <module>
    from watergrid.locks.PipelineLock import PipelineLock
  File "/<project_path>/venv/lib/python3.9/site-packages/watergrid/locks/__init__.py", line 1, in <module>
    from watergrid.locks.RedisPipelineLock import RedisPipelineLock
  File "/<project_path>/venv/lib/python3.9/site-packages/watergrid/locks/RedisPipelineLock.py", line 1, in <module>
    from redis import Redis
ModuleNotFoundError: No module named 'redis'

Expected behavior
Using StandalonePipeline should not depend on redis.

Watergrid specific
Watergrid version/commit: v1.1.0
Python version: 3.9 MacOS x86
Redis version (if using HAPipeline): None

Additional context
Current workaround is to import directly using the following:

from watergrid.pipelines.StandalonePipeline import StandalonePipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions