Skip to main content

Generate requirements[-dev].txt from Pipfile using pipenv

Project description

https://travis-ci.org/Stibbons/pipenv-to-requirements.svg?branch=master Pypi package MIT licensed

Generate requirements[-dev].txt from Pipfile (using pipenv)

Rational

Pipfile and its sibling Pipfile.lock are clearly superior tools defining clear dependencies or a package. Pipfile is to be maintained by the package’s developer while Pipfile.lock represent a clear image of what is currently installed on the current system, guarantying full reproductibility of the setup. See more information about Pipfile format here. Most of the time, Pipfile.lock should be ignored (ie, not tracked in your git) for packages published on Pypi.

pipenv is a great tool to maintain Pipfile, but developers might be stuck with backward compatibility issues for tools and services that still use requirements.txt and does not know how to handle Pipfile or Pipfile.lock yet.

For examples:

  • ReadTheDocs

  • Pyup

  • pip install (if you install a package with pip that does not have a requirements.txt, its dependencies won’t be installed, even if you use Pipfile)

Usage

Just before building source/binary/wheel package of your python module, execute:

To generate requirements files (ie, dependencies are described eventually by range):

pipenv run pipenv_to_requirements

To generate frozen requirements (ie, all dependencies have their version frozen):

pipenv run pipenv_to_requirements -f

It will generate requirements.txt and, if applicable, requirements-dev.txt, in the current directory.

Contributing

Create your development environment with

$ make dev

Execute unit tests:

$ make test

Build source, binary and wheels packages:

$ make dist

Code Style Checks:

$ make check

Code formatter:

$ make style

Create a release:

make requirements
git tag 1.2.3
make push

On successful Travis build on a Tag, your Pypi package will be updated automatically.

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

pipenv-to-requirements-0.1.4.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

pipenv_to_requirements-0.1.4-py2.py3-none-any.whl (10.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pipenv-to-requirements-0.1.4.tar.gz.

File metadata

File hashes

Hashes for pipenv-to-requirements-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ec7f0fa3bebd02d67ea532d1dba0ced7666d435467ee2e80beb124bfb2d3a5ca
MD5 163b1bad9095c841cd4a175f0cff7b75
BLAKE2b-256 16d9f4425d84ce390c42e38d56fd56b4a967885462cd700d1ef7b6a741163137

See more details on using hashes here.

File details

Details for the file pipenv_to_requirements-0.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pipenv_to_requirements-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 203dae0bd21c7afc640839a36d6ac4f132f5183621c4d854bda1f4af0d4c2de2
MD5 ab41f01159e95f3b7c1e35383730ea0a
BLAKE2b-256 6e67d81ede68abe8629e5990fd54e9e062c3592bd4beafd50ecb3dc467cfec11

See more details on using hashes here.

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