From 9f031316545794cd879b774d60b9d621b9a2a7df Mon Sep 17 00:00:00 2001 From: Aadi Joshi Date: Fri, 29 Nov 2024 01:00:36 +0530 Subject: [PATCH 1/2] Enhance: Extract dependencies from pip.yml to requirements.txt for Dependabot compatibility --- dependabot.yml | 9 ++ requirements.txt | 17 ++++ tasks/pip.yml | 251 +---------------------------------------------- 3 files changed, 30 insertions(+), 247 deletions(-) create mode 100644 dependabot.yml create mode 100644 requirements.txt diff --git a/dependabot.yml b/dependabot.yml new file mode 100644 index 00000000..fb16c879 --- /dev/null +++ b/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "./tasks" # Path where requirements.txt is located; adjust if it's in a subdirectory + schedule: + interval: "daily" # Change this to "weekly" or "monthly" if needed + open-pull-requests-limit: 5 # Optional: limit the number of open PRs from Dependabot + commit-message: + prefix: "fix" # Prefix for commit messages created by Dependabot diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..29fe7c81 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,17 @@ +attrs +channels_redis~=4.2.0 +django-celery-email +django-cors-headers~=4.4.0 +django-pipeline~=3.1.0 +django-redis~=5.4.0 +MySQL-python +psycopg2 +raven +service_identity +uwsgi +django~=4.0 # Replace with {{ openwisp2_django_version }} +openwisp2_controller # Install the latest version by default +openwisp2_network_topology # Install the latest version by default +openwisp2_firmware_upgrader # Install the latest version by default +openwisp2_monitoring # Install the latest version by default +openwisp2_radius # Install the latest version by default diff --git a/tasks/pip.yml b/tasks/pip.yml index 621b6d30..2c0545a5 100644 --- a/tasks/pip.yml +++ b/tasks/pip.yml @@ -1,248 +1,5 @@ ---- +# pip.yml +# Specifies project dependencies and references requirements.txt -- name: Update pip & related tools - pip: - name: - - pip - - setuptools - - wheel - - attrs - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - retries: 5 - delay: 10 - register: result - until: result is success - -- name: Remove jsonfield2 - pip: - name: - - jsonfield2 - state: absent - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - retries: 2 - delay: 5 - register: result - until: result is success - notify: Reload application - -- name: Install openwisp2 controller and its dependencies - pip: - name: - - "{{ openwisp2_controller_version }}" - - service_identity - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - environment: - LC_CTYPE: "en_US.UTF-8" - notify: Reload application - retries: 5 - delay: 10 - register: result - until: result is success - 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: Install django-redis - pip: - name: "django-redis~=5.4.0" - state: present - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - notify: Reload application - retries: 5 - delay: 10 - register: result - until: result is success - -- name: Install openwisp2 network topology and its dependencies - when: openwisp2_network_topology - pip: - name: "{{ openwisp2_network_topology_version }}" - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - notify: Reload application - retries: 5 - delay: 10 - register: result - until: result is success - tags: - - molecule-idempotence-notest - -- name: Install openwisp firmware upgrader and its dependencies - when: openwisp2_firmware_upgrader - pip: - name: "{{ openwisp2_firmware_upgrader_version }}" - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - notify: Reload application - retries: 5 - delay: 10 - register: result - until: result is success - tags: - - molecule-idempotence-notest - -- name: Install openwisp monitoring and its dependencies - when: openwisp2_monitoring - pip: - name: "{{ openwisp2_monitoring_version }}" - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - notify: Reload application - retries: 5 - delay: 10 - register: result - until: result is success - tags: - - molecule-idempotence-notest - -- name: Install openwisp2_radius and its dependencies - when: openwisp2_radius - pip: - name: "{{ openwisp2_radius_version }}" - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - notify: Reload application - retries: 5 - delay: 10 - register: result - until: result is success - tags: - - molecule-idempotence-notest - -- name: Install django-cors-headers - when: openwisp2_django_cors.get('enabled') - pip: - name: "django-cors-headers~=4.4.0" - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - retries: 5 - delay: 10 - register: result - until: result is success - notify: Reload application - -- name: Install extra python packages - pip: - name: "{{ openwisp2_extra_python_packages }}" - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - retries: 5 - delay: 10 - register: result - until: result is success - 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: Install uwsgi - pip: - name: uwsgi - state: latest - 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 - when: openwisp2_database.engine in ["django.db.backends.mysql", "django.contrib.gis.db.backends.mysql"] - pip: - name: MySQL-python - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - retries: 5 - delay: 10 - register: result - until: result is success - notify: Reload application - -- name: Install raven (sentry client) - when: openwisp2_sentry.get('dsn') - pip: - name: raven - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - retries: 5 - delay: 10 - register: result - until: result is success - notify: Reload application - -- name: Install django-celery-email - pip: - name: django-celery-email - state: latest - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - when: openwisp2_email_backend == "djcelery_email.backends.CeleryEmailBackend" - retries: 5 - delay: 10 - register: result - until: result is success - notify: Reload application - -- name: Install django - pip: - name: "{{ openwisp2_django_version }}" - state: present - virtualenv: "{{ virtualenv_path }}" - virtualenv_python: "{{ openwisp2_python }}" - retries: 5 - delay: 10 - register: result - until: result is success - notify: Reload application - tags: - - molecule-idempotence-notest +dependencies: + - "-r ../requirements.txt" From 204c4823165a3894ad81f404065866cb47487ecd Mon Sep 17 00:00:00 2001 From: Aadi Joshi Date: Fri, 29 Nov 2024 01:18:47 +0530 Subject: [PATCH 2/2] [Enhance] Extract dependencies from pip.yml to requirements.txt for Dependabot compatibility --- dependabot.yml | 8 ++++---- requirements.txt | 12 ++++++------ tasks/pip.yml | 3 --- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/dependabot.yml b/dependabot.yml index fb16c879..36b83c61 100644 --- a/dependabot.yml +++ b/dependabot.yml @@ -1,9 +1,9 @@ version: 2 updates: - package-ecosystem: "pip" - directory: "./tasks" # Path where requirements.txt is located; adjust if it's in a subdirectory + directory: "./tasks" # path of requirements.txt schedule: - interval: "daily" # Change this to "weekly" or "monthly" if needed - open-pull-requests-limit: 5 # Optional: limit the number of open PRs from Dependabot + interval: "daily" # can be changed to weekly or monthly + open-pull-requests-limit: 5 # to limit the number of open PRs from Dependabot commit-message: - prefix: "fix" # Prefix for commit messages created by Dependabot + prefix: "fix" # for commit messages created by Dependabot diff --git a/requirements.txt b/requirements.txt index 29fe7c81..65273b4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,9 +9,9 @@ psycopg2 raven service_identity uwsgi -django~=4.0 # Replace with {{ openwisp2_django_version }} -openwisp2_controller # Install the latest version by default -openwisp2_network_topology # Install the latest version by default -openwisp2_firmware_upgrader # Install the latest version by default -openwisp2_monitoring # Install the latest version by default -openwisp2_radius # Install the latest version by default +django~=4.0 +openwisp2_controller +openwisp2_network_topology +openwisp2_firmware_upgrader +openwisp2_monitoring +openwisp2_radius diff --git a/tasks/pip.yml b/tasks/pip.yml index 2c0545a5..c5838557 100644 --- a/tasks/pip.yml +++ b/tasks/pip.yml @@ -1,5 +1,2 @@ -# pip.yml -# Specifies project dependencies and references requirements.txt - dependencies: - "-r ../requirements.txt"