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

Convert requirements between formats

License

Notifications You must be signed in to change notification settings

orsinium-archive/install-requires

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Convert requirements between formats

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages