Skip to main content

pip-requirements (aka pyproject-requirements)

Install requirements/dependencies specified in a pyproject.toml using pip.

Features

  • Installs required, optional and/or all dependencies.
  • Detects and works with pip in installed in virtual environments.
  • Generates a requirements.txt file from a pyproject.toml (for tool compatibility).

Quick Start

  1. Install pip-requirements:

    pip install pyproject-requirements
    
  2. Install all dependencies of your pyproject.toml

    # use `--optional name` to limit to optional named dependency section
    # use `--required` to install required dependencies
    pip-requirements install --all path/to/pyproject.toml 
    

Why

  • This only exists because it's not builtin to pip.

  • Using requirements.txt files is primitive and redundant compared to the expressiveness of pyproject.toml files..

Usage

pip-requirements [-h] {install,txt} ...

Install dependencies from a pyproject file.

optional arguments:
-h, --help     show this help message and exit

commands:
Valid commands

install Command

pip-requirements install [-h] [--all] [--required] [--optional [OPTIONAL ...]] [--pip PIP] [--dry] pyproject_toml

positional arguments:
pyproject_toml        pyproject.toml

optional arguments:
-h, --help            show this help message and exit
--all                 Install dependencies from all known sections (required and optional).
--required            Install required dependencies.
--optional [OPTIONAL ...]
Optional dependency to install. May be specified multiple times.
--pip PIP             Pip tool to use. Autodetected. Default: /home/nate/.local/bin/pip
--dry                 Dry run

txt Command

pip-requirements txt [-h] [--all] [--required] [--optional [OPTIONAL ...]] pyproject_toml [output_file]

Generate a requirements.txt files for compatibility.

positional arguments:
  pyproject_toml        pyproject.toml
  output_file           path to a file to output. stdout otherwise.

optional arguments:
  -h, --help            show this help message and exit
  --all                 Include dependencies from all known sections (required and optional).
  --required            Include required dependencies.
  --optional [OPTIONAL ...]
                        Include optional dependency. May be specified multiple times.

Future

We should have something like:

pip install --optional=name --required --all path/to/pyproject.toml

Or:

pip requirements install --all path/to/pyproject.toml

Links

Metadata

Release files for pyproject-requirements 20240601

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyproject-requirements 20240601
File Size Uploaded Provenance Actions
pyproject_requirements-20240601.tar.gz 4.0 kB Without provenance Details for pyproject_requirements-20240601.tar.gz

Release files / pyproject_requirements-20240601.tar.gz

Download URL pyproject_requirements-20240601.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
134a531ca2acb3b77ac7e26c454d4a209dabfa6a47ba27a2ea0ea30c9fd1f8e2
BLAKE2b-256 checksum
How to use checksums
538a88e69dfa25aaa5af5b44f16afa6c88729d586e22fb9fdf1b5c17173c06d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for pyproject-requirements 20240601

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page