Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vlcinsky opened this issue Oct 5, 2021 · 2 comments

Comments

@vlcinsky
Copy link

vlcinsky commented Oct 5, 2021

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.

@Bogdanp
Copy link
Owner

Bogdanp commented Oct 6, 2021

Thanks for the report. I've dropped the version pins and everything seems fine. I'll release the change in the next couple of weeks.

@Bogdanp Bogdanp closed this as completed Oct 6, 2021
@vlcinsky
Copy link
Author

vlcinsky commented Oct 6, 2021

Thanks @Bogdanp . I planned to create PR with such a change but got stuck in initial long running tox tests (with few minor failures on python 3.9) so I am glad you did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants