Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions files/requirements-celery-email.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
django-celery-email~=3.0.0
1 change: 1 addition & 0 deletions files/requirements-cors-headers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
django-cors-headers~=4.4.0
1 change: 1 addition & 0 deletions files/requirements-mysql.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mysqlclient~=2.2
1 change: 1 addition & 0 deletions files/requirements-postgresql.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
psycopg2~=2.9
4 changes: 4 additions & 0 deletions files/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
channels_redis~=4.2.0
django-redis~=5.4.0
django-pipeline~=3.1.0
uwsgi~=2.0.30
1 change: 0 additions & 1 deletion molecule/resources/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
openwisp_controller.config.tests.test_admin.TestAdmin.test_vpn_preview_button \
openwisp_controller.config.tests.test_admin.TestAdmin.test_device_queryset \
openwisp_controller.config.tests.test_admin.TestAdmin.test_device_organization_fk_autocomplete_view \
openwisp_controller.config.tests.test_admin.TestAdmin.test_device_templates_m2m_queryset \
Copy link
Member Author

Choose a reason for hiding this comment

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

Since this test was removed in openwisp/openwisp-controller#1010, so I removed it here. I later tried to use the selenium equivalent test, but the test run failed because the selenium package isn’t installed.

Should we add selenium (and this test) back?

Copy link
Member

Choose a reason for hiding this comment

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

Yes it would be useful to run selenium tests, please open an issue for this and we can follow up after this is merged.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #530 @nemesifier

openwisp_controller.config.tests.test_admin.TestAdmin.test_template_queryset \
openwisp_controller.config.tests.test_admin.TestAdmin.test_template_organization_fk_autocomplete_view \
openwisp_controller.config.tests.test_admin.TestAdmin.test_template_vpn_fk_autocomplete_view \
Expand Down
89 changes: 38 additions & 51 deletions tasks/pip.yml
Copy link
Member

Choose a reason for hiding this comment

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

@nemesifier are you sure about having three different requirements.txt in /opt/openwisp2?

If possible, I would look for a way to merge the files into one requirements.txt on the remote system.

Copy link
Member

@nemesifier nemesifier Jul 23, 2025

Choose a reason for hiding this comment

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

What's the advantage? I don't see any.. and I see the disadvantage that the tasks building the unified requirements.txt file may not be idempotent.

Copy link
Member

Choose a reason for hiding this comment

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

At that moment, I thought that it would simply re-installing the dependencies manually on the target machine if required.

Now, I think we should promote users to only use the ansible role to manage dependencies. I agree with your conclusion.

Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,14 @@
tags:
- molecule-idempotence-notest

- name: Install channels_redis~=4.2.0
pip:
name:
- channels_redis~=4.2.0
state: latest
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
retries: 1
delay: 10
register: result
until: result is success
- name: Copy requirements.txt
copy:
src: requirements.txt
dest: "{{ openwisp2_path }}/requirements.txt"

- name: Install django-redis
- name: Install python requirements
pip:
name: "django-redis~=5.4.0"
state: present
requirements: "{{ openwisp2_path }}/requirements.txt"
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
notify: Reload application
Expand Down Expand Up @@ -117,13 +109,18 @@
tags:
- molecule-idempotence-notest

- name: Install django-cors-headers
- name: Copy requirements-cors-headers.txt
copy:
src: requirements-cors-headers.txt
dest: "{{ openwisp2_path }}/requirements-cors-headers.txt"
when: openwisp2_django_cors.get('enabled')

- name: Install django-core-headers requirements
pip:
name: "django-cors-headers~=4.4.0"
state: latest
requirements: "{{ openwisp2_path }}/requirements-cors-headers.txt"
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
when: openwisp2_django_cors.get('enabled')
retries: 5
delay: 10
register: result
Expand All @@ -143,51 +140,36 @@
notify: Reload application
tags: [extra_pip]

- name: Install static minification dependencies
pip:
name:
- django-pipeline~=3.1.0
state: latest
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
retries: 5
delay: 10
register: result
until: result is success
notify: Reload application
- name: Copy requirements-postgresql.txt
copy:
src: requirements-postgresql.txt
dest: "{{ openwisp2_path }}/requirements-postgresql.txt"
when: openwisp2_database.engine in ["django.db.backends.postgresql", "django.contrib.gis.db.backends.postgis"]

- name: Install uwsgi
- name: Install PostgreSQL driver requirements
pip:
name: uwsgi
state: latest
requirements: "{{ openwisp2_path }}/requirements-postgresql.txt"
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
retries: 5
delay: 10
register: result
until: result is success
notify: Reload application

- name: Install psycopg2
when: openwisp2_database.engine in ["django.db.backends.postgresql", "django.contrib.gis.db.backends.postgis"]
pip:
name: psycopg2
state: latest
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
retries: 5
delay: 10
register: result
until: result is success
notify: Reload application

- name: Install MySQL-python
- name: Copy requirements-mysql.txt
copy:
src: requirements-mysql.txt
dest: "{{ openwisp2_path }}/requirements-mysql.txt"
when: openwisp2_database.engine in ["django.db.backends.mysql", "django.contrib.gis.db.backends.mysql"]

- name: Install MYSQL driver requirements
pip:
name: MySQL-python
state: latest
requirements: "{{ openwisp2_path }}/requirements-mysql.txt"
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
when: openwisp2_database.engine in ["django.db.backends.mysql", "django.contrib.gis.db.backends.mysql"]
retries: 5
delay: 10
register: result
Expand All @@ -207,18 +189,23 @@
until: result is success
notify: Reload application

- name: Install django-celery-email
- name: Copy requirements-celery-email.txt
copy:
src: requirements-celery-email.txt
dest: "{{ openwisp2_path }}/requirements-celery-email.txt"
when: openwisp2_email_backend == "djcelery_email.backends.CeleryEmailBackend"

- name: Install celery-email requirements
pip:
name: django-celery-email
state: latest
requirements: "{{ openwisp2_path }}/requirements-celery-email.txt"
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "{{ openwisp2_python }}"
when: openwisp2_email_backend == "djcelery_email.backends.CeleryEmailBackend"
notify: Reload application
retries: 5
delay: 10
register: result
until: result is success
notify: Reload application

- name: Install django
pip:
Expand Down