A smart Python package updater that safely upgrades dependencies while verifying tests pass.
Project description
Python Package Updater
Python Package Updater is a robust tool designed to streamline the process of updating Python package dependencies in your projects. Keeping your dependencies up-to-date is crucial for maintaining security, performance, and compatibility with the latest features. However, this process can often be tedious and error-prone, especially when dealing with complex projects or multiple dependencies.
This tool automates the entire workflow of dependency updates, from detecting outdated packages to validating their compatibility through testing. By leveraging isolated virtual environments and automated test discovery, Python Package Updater ensures that updates are applied safely without breaking your project.
Features
- Dependency Detection: Automatically detects dependencies from
requirements.txtorPipfile. - Test Discovery: Finds and runs tests with the
test_prefix or pytest decorators. - Isolated Testing: Creates isolated virtual environments to test updates without affecting your system environment.
- Update Analysis: Analyzes available package updates and determines compatibility.
- Safe Updates: Ensures updates are applied only if all tests pass.
- Customizable Options: Allows you to specify packages to update, perform dry runs, or skip tests based on your requirements.
Architecture Diagram
Installation
Clone the repository and initialize the virtual environment:
git clone https://github.com/Harman22/py-package-updater.git
cd py_package_updater
make init
Usage
You can use the tool either via Makefile commands or directly through the CLI.
Using Makefile Commands
-
Initialize the environment:
make init -
Install dependencies:
make install -
Install development dependencies:
make install-dev -
Format the code:
make format -
Lint the code:
make lint -
Run tests:
make test
Using CLI Options
Run the tool directly on your Python project directory:
python -m py_package_updater /path/to/your/project
Command-Line Options
--packages: Specify specific packages to update (default: all packages).--dry-run: Run without making any changes.--verbose: Show detailed output.--skip-tests: Skip running tests (not recommended).
Examples
Update all packages in the current directory:
python -m py_package_updater .
Update specific packages:
python -m py_package_updater . --packages requests pytest
Perform a dry run to preview changes:
python -m py_package_updater . --dry-run
Requirements
- Python 3.8+
virtualenvpytestrequestspackaging
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Run the tests to ensure your changes do not break existing functionality.
- Lint your code to ensure it adheres to the project's coding standards.
- Format your code to maintain consistency.
- Commit your changes and push them to your fork.
- Submit a pull request with a detailed description of your changes.
Support
If you encounter any issues or have questions, feel free to open an issue on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_package_updater-0.1.3.tar.gz.
File metadata
- Download URL: py_package_updater-0.1.3.tar.gz
- Upload date:
- Size: 66.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e8cb5f452317b4d4fe23dd88333b89d63bc5176a93155000347e82010efeac1
|
|
| MD5 |
97fa1cc8b0d2609785f60e48395feaaf
|
|
| BLAKE2b-256 |
20ad413da2488b447e4a4b4ed4619d99dccbd339c24ea4fafabc4c4ca7b4e624
|
File details
Details for the file py_package_updater-0.1.3-py3-none-any.whl.
File metadata
- Download URL: py_package_updater-0.1.3-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1ddc76dfd89eb1b2e8c5990184b3ada32b6d892f06de91f7e8d773805937c58
|
|
| MD5 |
ee09c64960f0916b3350437d113513de
|
|
| BLAKE2b-256 |
33bbbd53a7ab7137a3acbdc9cbe9db50927ed96393046c390615b7b466edc78d
|