-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
[change] Move python dependencies to requirements.txt file #511
base: master
Are you sure you want to change the base?
[change] Move python dependencies to requirements.txt file #511
Conversation
- Modified pip.yml to install dependencies from requirements.txt - Used role_path variable to reference requirements.txt in files directory - Implemented pip constraints to maintain version control from Ansible variables - Kept an extra_python_packages handling for custom additions - and preserved existing retry logic and environment settings
- Here grouped dependencies by their functionality (core, database, optional) - Added few comments to indicate optional packages and their purpose - While maintaining existing version constraints for critical packages - I've ensured compatibility with current OpenWISP installation process
- Added pip package ecosystem to dependabot configuration - While setting up weekly update schedule for dependency checks - Added all 'dependencies' and 'python' labels for better PR organization
.github/dependabot.yml
Outdated
interval: "monthly" # Check for updates weekly | ||
commit-message: | ||
prefix: "[ci] " | ||
prefix: "deps" |
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.
prefix: "deps" | |
prefix: "[deps]" |
.github/dependabot.yml
Outdated
commit-message: | ||
prefix: "[deps] " | ||
- package-ecosystem: "github-actions" # Check for GitHub Actions updates |
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.
Why are you removing github-actions
? Please don't.
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.
I've made the fix for this in my recent commit
- Maintained consistent prefix formatting using square brackets: [deps] for pip and [ci] for GitHub Actions - Restored the GitHub Actions ecosystem configuration - Setup both update intervals to "weekly" as originally intended
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.
@shwetd19 the build is failing. Please execute the tests locally before pushing.
Hey @nemesifier , The main issue was that the requirements.txt file cannot be found during the installation process. The error message was consistent across different Ubuntu and Debian environments I've made the possible fix and did tested it properly this time can you please review my PR |
Hey @pandafy @nemesifier can you please reivew this PR ? |
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.
Let's only extract the Python dependencies which are pinned to a version. Take a note to respect the when
condition of the existing tasks that installs Python modules. The role does not install all Python packages everytime.
.github/dependabot.yml
Outdated
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.
I don't think we need any changes for this file.
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.
fixed dependabot as it was previously in my latest commit
files/requirements.txt
Outdated
psycopg2 | ||
MySQL-python |
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.
These packages are installed only when specific database backends are used. Since, we are installing the latest version of these packages, adding them here is not fruitful.
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.
modified requirements.txt file for removing Database adapters
tasks/pip.yml
Outdated
state: latest | ||
state: present |
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.
Why did you change this? latest
allows to upgrade the Python modules when using compatibility versioning. Same for other instances.
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.
modified pip.yml for database adapters psycopg2 & MySQL-python and to fix the state as latest
Hello @pandafy I've implemented the suggested changes in my recent commits, can you please check that once, Thanks! |
Checklist
Reference to Existing Issue
Closes #507
Description of Changes
This PR here implements automated dependency management using Dependabot by extracting Python dependencies from
pip.yml
into a dedicatedrequirements.txt
file.Key Changes:
New Requirements File
files/requirements.txt
containing all Python dependenciesUpdated Package Installation
tasks/pip.yml
to use the new requirements fileDependabot Configuration
Testing Details:
Installation Testing
Tested with various configurations:
Integration Testing
Benefits:
Screenshots