Skip to main content

Proviso requirements.txt management

Project description

Proviso requirements.txt management

A tool for managing requirements.txt version pinning and updating. Proviso extracts dependencies from your project's setup.py or pyproject.toml, resolves all transitive dependencies using PyPI, and generates a fully pinned requirements.txt file that works across multiple Python versions.

Installation

Command line

pip install proviso

requirements.txt/setup.py

Pinning specific versions or SHAs is recommended to avoid unplanned upgrades.

Versions
# Start with the latest versions and don't just copy what's here
proviso==0.0.1
SHAs
# Start with the latest/specific versions and don't just copy what's here
-e git+https://git@github.com/octodns/proviso.git@ec9661f8b335241ae4746eea467a8509205e6a30#egg=proviso

Usage

Basic usage

Generate a requirements.txt for all currently active Python versions:

proviso

This will:

  1. Read dependencies from your project's setup.py or pyproject.toml
  2. Resolve all transitive dependencies from PyPI
  3. Generate a requirements.txt with pinned versions that work across all currently active Python versions (queried from endoflife.date)

Common options

Generate requirements for specific Python versions:

proviso --python-versions 3.10,3.11,3.12

Include specific extras (e.g., dev dependencies):

proviso --extras dev,test

Specify a custom output file:

proviso --filename requirements-dev.txt

Customize the header comment:

proviso --header "# Generated requirements - do not edit"

Full command-line reference

usage: proviso [-h] [--directory DIRECTORY] [--extras EXTRAS] [--python-versions PYTHON_VERSIONS] [--filename FILENAME]
               [--level {DEBUG,INFO,WARNING,ERROR}] [--header HEADER]

Extract project requirements, resolve dependencies, and manage requirements.txt

options:
  -h, --help            show this help message and exit
  --directory DIRECTORY
                        Project root directory (default: current directory)
  --extras EXTRAS       Comma-separated list of extras to include (e.g., "dev,test"). Defaults to all defined extras.
  --python-versions PYTHON_VERSIONS
                        Comma-separated list of Python versions (e.g., "3.9,3.10,3.11"). Defaults to currently active versions
                        per endoflife.date.
  --filename FILENAME   Output filename or path for requirements (default: requirements.txt). If just a filename, will be placed
                        in --directory; if a path, will be used as-is.
  --level {DEBUG,INFO,WARNING,ERROR}
                        Logging level (default: WARNING)
  --header HEADER       Header comment to place at the top of the requirements file. Use the string "[command line]" to insert the
                        actual command that was run. (default: "# DO NOT EDIT THIS FILE DIRECTLY - use [command line]")

Features

  • Multi-version support: Generates a single requirements.txt that works across multiple Python versions, using environment markers (e.g., package==1.0.0; python_version=='3.10') when different versions are needed
  • Complete dependency resolution: Recursively resolves all transitive dependencies from PyPI
  • Automatic Python version detection: Uses endoflife.date API to determine currently active Python versions
  • Extras support: Include optional dependency groups (dev, test, etc.) from your setup.py or pyproject.toml
  • Flexible output: Generate requirements files with custom names and locations

Development

See the /script/ directory for some tools to help with the development process. They generally follow the Script to rule them all pattern. Most useful is ./script/bootstrap which will create a venv and install both the runtime and development related requirements. It will also hook up a pre-commit hook that covers most of what's run by CI.

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

proviso-0.0.1.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

proviso-0.0.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file proviso-0.0.1.tar.gz.

File metadata

  • Download URL: proviso-0.0.1.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for proviso-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d6eda6e3a609cea3e0d3b1965dfc5d2b5fc6d52e84ec3ec72a9874d48993826e
MD5 1b7ae3e94727730010f1cfdea17730a4
BLAKE2b-256 d3534314420b4f4999f8a60bd209a14c0cb6567b80aafc83edc5a524c88836ce

See more details on using hashes here.

File details

Details for the file proviso-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: proviso-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for proviso-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e44c175c77abd1f17cd178c6d87560f7a34854305421f352e5035704269e5b61
MD5 c4138c7f5c2d221e715c345898d33f2d
BLAKE2b-256 8de57374005ac3655b125da635e8a80d6208d82306e67facb36d473f1d9a6e26

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