Skip to content

Watchdog outdated version causes failure in Python 3.10 with MutableSet not found #428

Description

@vlcinsky

Issues

GitHub issues are for bugs. If you have questions, please ask them on the discussion board.

What OS are you using?

Debian 11

What version of Dramatiq are you using?

dramatic==1.11.0

What did you do?

Tried to run dramatiq under python 3.10

When dramatiq installed with watch extras, the dramatiq command fails:

$ dramatiq dramatiq_test.actors
Traceback (most recent call last):
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/bin/dramatiq", line 5, in <module>
    from dramatiq.__main__ import main
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/lib/python3.10/site-packages/dramatiq/__main__.py", line 20, in <module>
    from dramatiq.cli import main
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/lib/python3.10/site-packages/dramatiq/cli.py", line 40, in <module>
    from .watcher import setup_file_watcher
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/lib/python3.10/site-packages/dramatiq/watcher.py", line 6, in <module>
    import watchdog.observers.polling
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/lib/python3.10/site-packages/watchdog/observers/__init__.py", line 63, in <module>
    from .inotify import InotifyObserver as Observer
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/lib/python3.10/site-packages/watchdog/observers/inotify.py", line 76, in <module>
    from watchdog.observers.api import (
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/lib/python3.10/site-packages/watchdog/observers/api.py", line 23, in <module>
    from watchdog.utils.bricks import SkipRepeatsQueue
  File "/home/javl/devel/ttr/gitlab/koa/dramatiq_test/.venv/lib/python3.10/site-packages/watchdog/utils/bricks.py", line 175, in <module>
    class OrderedSet(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'

What did you expect would happen?

I expected the dramatiq to function without problem.

What happened?

Python 3.10 finally moved MutableSet from collections to collections.abc

Older versions of watchdog were importing MutableSet from collections what was causing issue as gorakhargosh/watchdog#486

However, the issue is already resolved in watchdog but it still applies to dramatiq as it is fixing old version in setup.py to version 0.8.x and preventing the latest version of watdhdog==2.1.6 to install.

Workaround

Do not install dramatiq with watch extras.

Proposed solution

Test dramatiq with the latest watchdog version and if it works, allow latest version in dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions