-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
[feature] Upgrade to channels 4.x #332
Conversation
- Updated websocket consumer to use AsyncWebsocketConsumer - Updated routing to use re_path - Updated handlers to use async/await pattern - Updated channels dependency to >=4.0.0,<5.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build is failing, please run the sample app tests locally with the following command to see if you can replicate:
SAMPLE_APP=1 ./runtests.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue still persists.
I was able to replicate the issue with these commands:
mkvirtualenv --python=python3 channels4
pip install -e . && pip install -r requirements-test.txt
SAMPLE_APP=1 ./runtests.py
Test output:
======================================================================
ERROR: openwisp2.sample_notifications.tests.test_websockets (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: openwisp2.sample_notifications.tests.test_websockets
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/home/nemesis/Code/openwisp/openwisp-notifications/tests/openwisp2/sample_notifications/tests/test_websockets.py", line 1, in <module>
from openwisp_notifications.tests.test_websockets import (
File "/home/nemesis/Code/openwisp/openwisp-notifications/openwisp_notifications/tests/test_websockets.py", line 9, in <module>
from channels.testing import WebsocketCommunicator
File "/home/nemesis/.virtualenvs/channels4/lib/python3.8/site-packages/channels/testing/__init__.py", line 3, in <module>
from .live import ChannelsLiveServerTestCase # noqa
File "/home/nemesis/.virtualenvs/channels4/lib/python3.8/site-packages/channels/testing/live.py", line 3, in <module>
from daphne.testing import DaphneProcess
ModuleNotFoundError: No module named 'daphne'
Are you able to replicate this issue locally @AviGawande?
@nemesifier I tried to replicate the issue but i am getting different error.
I tried changes locally but it didn't worked for |
@AviGawande the fact that you get a different error means that probably you're not executing the same steps of the CI build.
|
@nemesifier I followed the same steps you mentioned but still got this error.
|
@AviGawande please enable your python virtualenv and tell me what's the output of the following command?
|
@nemesifier my venv is activated but still this issue persists.
|
@AviGawande make sure you you have Django 4.2, not sure channels 4 supports Django 3.2 (please check). Make also sure your openwisp-notifications fork is installed in your python virtual env. |
@nemesifier Sure,I am thinking of brute forcing this issue ,means i will close this PR and test and build the changes locally and will then Raise PR. |
Checklist
Reference to Existing Issue = #388
Fixes centralize-django-channels
Please open a new issue if there isn't an existing issue yet.
Description of Changes
Please describe these changes.
Screenshot
Please include any relevant screenshots.