Pipenv: `pipenv lock -r` is not deterministic

Created on 18 Dec 2017  ·  3Comments  ·  Source: pypa/pipenv

Describe your environment

Ubuntu 17.04, Python 3.5.3, pipenv 9.0.1

Expected result

pipenv lock -r returns the exact same output when given the same Pipfile and Pipfile.lock.

Actual result

pipenv lock -r randomly reorders lines on each run. This becomes a problem when combined with pipenv lock -r > requirements.txt and version control, as it chances requirements.txt even if there is no actual change.

Steps to replicate

Create a project with Pipfile and Pipfile.lock (mine for reference). Run pipenv lock -r.

Workaound

A possible workaround is pipenv lock -r | sort.

All 3 comments

@kennethreitz Why was this closed?

send a pull request if you want to fix it!

While not a real solution to the problem, why not generate requirements.txt on the fly when you need it? In fact, I would argue that you shouldn't commit it since at best it just duplicates whatever is in Pipfile and at worst they would differ because someone forgot to do pipenv lock -r > requirements.txt.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacek-jablonski picture jacek-jablonski  ·  3Comments

jeyraof picture jeyraof  ·  3Comments

leileigong picture leileigong  ·  3Comments

hynek picture hynek  ·  3Comments

erinxocon picture erinxocon  ·  3Comments