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.2.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.2-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py_package_updater-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5afc9d187f19c0a0cf4d712067decb55c02e909d803ae6c7c6a780a27e04bd31
MD5 e038694bc13d3079c775a353dc4cad52
BLAKE2b-256 ee6435c15801cc9fcbdb4ccffe169e64142d3c53d105dadd8a0ec6c7b7119d9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_package_updater-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 426f392d3c66090613668595b2fe305d6551888d05c5f6c885632dc58fc56b61
MD5 402d874f26a4f86bad7438fee96e517b
BLAKE2b-256 14d3c211530b4d74ca9128c82ccad7464616093534ed167836feb6fc129770f1

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