Skip to content

Conversation

@pandafy
Copy link
Member

@pandafy pandafy commented Apr 1, 2025

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Blockers

Closes #340

@pandafy pandafy force-pushed the deps-channels branch 5 times, most recently from 38289f5 to 3d247ca Compare April 1, 2025 14:47
@@ -1,7 +1,4 @@
openwisp-utils[qa,selenium] @ https://github.com/openwisp/openwisp-utils/tarball/1.2
openwisp-utils[qa,selenium,channels, channels-test] @ https://github.com/openwisp/openwisp-utils/tarball/issues/388-channels
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Update this once PR in openwisp-utils is merged.

@pandafy pandafy changed the title [deps] Install channels dependencies from openwisp-utils extras [deps] Add support for Django 5.x and update channels Apr 2, 2025
@pandafy pandafy force-pushed the deps-channels branch 6 times, most recently from be25baf to 78e42f7 Compare April 3, 2025 13:52
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions below.

raise ImproperlyConfigured(f'No such Notification Choice {notification_type}')


def get_notification_choices():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is necessary?

I don't see the django docs saying that passing a callable is necessary for choice fields. Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the comment in the code to explain the implementation details of Django

From the docs:

Passing a callable for choices can be particularly handy when, for example, the choices are:

  • the result of I/O-bound operations (which could potentially be cached), such as querying a table in the same or an external database, or accessing the choices from a static file.

  • a list that is mostly stable but could vary from time to time or from project to project. Examples in this category are using third-party apps that provide a well-known inventory of values, such as currencies, countries, languages, time zones, etc.

We fall in the second point. The NOTIFICATION_CHOICES changes when registering/unregistering notification types.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, point I was forgetting this important detail for a moment.

'Operating System :: OS Independent',
'Framework :: Django',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update this consistently with the other modules please?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok great, maybe the other modules I saw were libraries and we use more classifiers there.

- Dropped support for Python < 3.9
- Dropped support for Django < 4.2

Closes #340
raise ImproperlyConfigured(f'No such Notification Choice {notification_type}')


def get_notification_choices():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, point I was forgetting this important detail for a moment.

'Operating System :: OS Independent',
'Framework :: Django',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok great, maybe the other modules I saw were libraries and we use more classifiers there.

@github-project-automation github-project-automation bot moved this from To do (general) to In progress in OpenWISP Contributor's Board Apr 4, 2025
@nemesifier nemesifier merged commit be3e1db into master Apr 4, 2025
21 checks passed
@nemesifier nemesifier deleted the deps-channels branch April 4, 2025 21:34
@github-project-automation github-project-automation bot moved this from In progress to Done in OpenWISP Contributor's Board Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[deps] Add support for Django 5.0 & 5.1 and Python 3.11, 3.12 & 3.13

3 participants