Skip to main content

Update and resolve requirements.txt based on the Python environment and pip used.

Project description

Python Requirements Updater

Not a pur, but pru. Update and resolve requirements.txt based on the Python environment and pip used.

Installation

pip install pru

Usage

Using CLI:

pru "requirements.txt" upgrade_requirements --cmd "pip install --upgrade"

Using python:

from pru import (
    get_installed_requirements_packages_and_version,
    get_installed_packages_name_and_version,
    replace_requirements_packages_versions,
    upgrade_requirements,
)


file_path = 'requirements.txt'
# print(get_installed_requirements_packages_and_version(file_path))
# print(get_installed_packages_name_and_version())
# replace_requirements_packages_versions(file_path)
upgrade_requirements(file_path, command='pip install --upgrade')

Known Issue

In python3.7, pru "sometimes" can't install and update requirements using a single call of upgrade_requirements. To fix this, simply run two times.

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

pru-0.0.1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

pru-0.0.1-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

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