Package: pipenv-to-requirements
Generaterequirements[-dev].txtfromPipfile(usingpipenv).
Used in mymodern Python module project cookiecutter.
template.Free software: MITDocumentation:https://pipenv-to-requirements.readthedocs.org/en/latest/Source:https://github.com/gsemet/pipenv-to-requirementsRationalPipfileand its siblingPipfile.lockare clearly superior tools defining clear dependencies
or a package.Pipfileis to be maintained by the package’s developer whilePipfile.lockrepresent a clear image of what is currently installed on the current system, guarantying full
reproductibility of the setup. See more information aboutPipfile format here. Most of the time,Pipfile.lockshould be ignored (ie, not
tracked in your git) for packages published on Pypi.pipenvis a great tool to maintainPipfile, but
developers might be stuck with backward compatibility issues for tools and services that still userequirements.txtand does not know how to handlePipfileorPipfile.lockyet.For examples:Read the DocsPyup(experimental support isarriving)Any library that usesPBR(*)pip install(if you install a package withpipthat does not have arequirements.txt,
its dependencies won’t be installed, even if you usePipfile)(*): for the moment, I recommend to generate at leastrequirements.txt(without version
freeze) for the libraries using PBR that you publish on Pypi. Remember PBR automatically synchronize
the content ofrequirements.txtfound at the root of a package withsetup.pyof this package.
This allows automatic installation of the very dependencies of your package.
Without this file, your package will be installed bypip, but its dependencies will be ignored.
Support in PBR may be added in the future (see thisthis patch).For build reproductibility, I also recommend tocheck inyour lock file even for libraries,
so that your CI won’t fail when new packages is published on Pypi.UsageJust before building source/binary/wheel package of your python module, only of the following
commands:To generate requirements files (ie, dependencies are described eventually by range), typically
forlibraries:pipenvrunpipenv_to_requirementsTo generate frozen requirements (ie, all dependencies have their version frozen), typically forapplications:pipenvrunpipenv_to_requirements-fIt will generaterequirements.txtand, if applicable,requirements-dev.txt, in the current
directory.Also possible:pipenvrunpipenv_to_requirements-drequirements-dev-custom.txtpipenvrunpipenv_to_requirements-drequirements-dev-custom.txt-fpipenvrunpipenv_to_requirements-orequirements-custom.txtpipenvrunpipenv_to_requirements-orequirements-custom.txt-fpipenvrunpipenv_to_requirements-drequirements-dev-custom.txt-orequirements-custom.txt-fExample using a Makefile:dev:
    pipenv install --dev
    pipenv run pip install -e .

dists: requirements sdist bdist wheels

requirements:
    # For a library, use:
    pipenv run pipenv_to_requirements
    # For an application, use:
    # pipenv run pipenv_to_requirements -f

sdist: requirements
    pipenv run python setup.py sdist

bdist: requirements
    pipenv run python setup.py bdist

wheels: requirements
    pipenv run python setup.py bdist_wheelJust usemake requirementsto refresh therequirements.txt.Read the DocsSimply commit these files in your tree so that Read the Rocs, and ensure they are synchronized each
time you change yourPipfile. Do not forget to ask Read the Docs to userequirements-dev.txtwhen building the documentation.ContributingCreate your development environment with$makedevExecute unit tests:$maketestCode formatter:$makestyleCode Style Checks:$makecheck