Skip to main content

Extractor for python dependencies form pyproject.toml file and create requirements.txt file to be used in docker image builds

Project description

pydep_extractor

How to Use pydep_extractor

This script extracts the dependencies from the pyproject.toml file and writes them to a requirements.txt file.

The requirements.txt file is used by the Dockerfile to install the dependencies before installing the application. This is done to speed up the build process and improve caching.

Installation

pip install pydep_extractor

Usage

  • To process a specific pyproject.toml file and create a requirements.txt file:

    python -m pydep_extractor path/to/pyproject.toml
    
  • To install the dependency without creating a requirements.txt file:

    python -m pydep_extractor path/to/pyproject.toml --install
    
  • To set a non-default pip command:

    python -m pydep_extractor path/to/pyproject.toml --pip-command pip3
    
  • To ignore specific requirements:

    python -m pydep_extractor path/to/pyproject.toml --ignore string1 string2
    
  • To specify a different output file for the dependencies:

    python -m pydep_extractor path/to/pyproject.toml --output path/to/requirements.txt
    
  • To specify a different output file for the pyproject if using the ignore dependency options:

    python -m pydep_extractor path/to/pyproject.toml --pyproject-output path/to/pyproject_filtered.toml
    

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

pydep_extractor-0.1.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

pydep_extractor-0.1.0-py3-none-any.whl (4.5 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