Skip to content

Flask-Melodramatiq broken with dramatiq>=2.0 #635

Description

@jborsky

Since dramatiq 2.0, the Results object requires an explicit backend argument (changelog). Flask-Melodramatiq calls Results() without it, causing a TypeError on broker initialization.

I've discovered it through a failed page tests run. Where the environment now resolves dramatiq 2.1.0 when installing dependencies.

    RedisBroker(app, middleware=broker_middleware) if not app.testing else StubBroker(app, middleware=broker_middleware)
/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/flask_melodramatiq/lazy_broker.py:147: in __init__
    self.__empty_backend = dramatiq.results.Results()
E   TypeError: Results.__init__() missing 1 required keyword-only argument: 'backend'

Flask-Melodramatiq is unmaintained, so I think we have two options:

  • Contribute upstream and fix it
  • Drop the dependency and write our own middleware for what we need

For now, I will just pin the dramatiq to < 2.0 so our actions work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filewebStuff related to the web at seccerts.org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions