Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Latest commit

 

History

History
69 lines (48 loc) · 1.43 KB

README.md

File metadata and controls

69 lines (48 loc) · 1.43 KB

install_requires

DEPRECATED: use dephell instead. It can do the same and much more.

Convert between dependency describing formats.

Input formats:

  • Pipfile
  • Pipfile.lock
  • pyproject.toml (poetry)
  • requirements.txt

Output formats:

  • setup.py (return install_requires and dependency_links)
  • requirements.txt (return list of lines)

Install

Install with needed extra requirements:

pip install install-requires[pipfile]
pip install install-requires[poetry]

Or from your setup.py:

from pip._internal import main as pip

pip(['install', 'install-requires[pipfile]'])
pip(['install', 'install-requires[poetry]'])

CLI usage

install-requires example/Pipfile requirements.txt

Available conversions:

  1. Pipfile -> requirements.txt
  2. Pipfile.lock -> requirements.txt
  3. pyproject.toml -> requirements.txt

API usage

Pass input format, output format and path to file that must be parsed into convert function:

from pathlib import Path
from install_requires import convert

path = Path(__file__).parent
convert('pyproject.toml', 'setup.py', path)

Available conversions:

  1. Pipfile -> requirements.txt
  2. Pipfile.lock -> requirements.txt
  3. pyproject.toml -> requirements.txt
  4. Pipfile -> setup.py
  5. Pipfile.lock -> setup.py
  6. pyproject.toml -> setup.py
  7. requirements.txt -> setup.py

See example for more details.