Skip to main content

A smart Python package updater that safely upgrades dependencies while verifying tests pass.

Project description

Python Package Updater

Supported Python Versions

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.txt or Pipfile.
  • 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

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+
  • virtualenv
  • pytest
  • requests
  • packaging

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. 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.
  3. Commit your changes and push them to your fork.
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_package_updater-0.1.1.tar.gz (66.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_package_updater-0.1.1-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file py_package_updater-0.1.1.tar.gz.

File metadata

  • Download URL: py_package_updater-0.1.1.tar.gz
  • Upload date:
  • Size: 66.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for py_package_updater-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d6d0fa9d69b04a80a78573fcb23163052c0bd746115d7891e2fd697943fd115f
MD5 6b4b9acde7491ab0e595bb33d19729be
BLAKE2b-256 87681b2939881d96b07d7529f8cf5e6727314b90b4847926953e5304bce352d6

See more details on using hashes here.

File details

Details for the file py_package_updater-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_package_updater-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 915c182c685be24b3791bb498e691373bc11bd943a9d60f25c9829bb7f90bdf4
MD5 88a703c3cfcec75db0723d9383289137
BLAKE2b-256 a1b3f3eb36bcd0a207622d37b4bbe28548df546fd8763c1ac461465265d3f088

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page