Add `--pipfile Pipfile.lock` as an alternative of `-r requirements.txt`
See original GitHub issueWhat’s the problem this feature will solve?
I use container to deploy Python application to production. The container building script performs the following command lines:
python3 -m pip install pipenv
python3 -m pipenv sync # Install modules from Pipenv.lock
python3 -m pipenv run python3 -m pip freeze > requirements.txt
python3 -m pip install -r requirements.txt
python3 -m pip uninstall pipenv
rm requirements.txt
Describe the solution you’d like
Replace the above command lines by just one pretty pip
option:
python3 -m pip install --pipfile Pipfile.lock
Additional context
The project https://github.com/pypa/pipfile/blob/master/README.rst states:
Pipfile
and its sisterPipfile.lock
are a replacement for the existing standardpip
’srequirements.txt
file.
Let’s start the movement by adding an experimental option in next pip
release 😄
EDIT: My colleague has just pointed me that this has already been (eventually) planed. The same document, at chapter Pip Integration (eventual) says:
pip
will grow a new command line option,-p
/--pipfile
to install the versions as specified in aPipfile
, similar to its existing-r
/--requirement
argument for installingrequirements.txt
files.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:10 (7 by maintainers)
Top GitHub Comments
I’m not sure there’s consensus that
pipenv.lock
is a replacement forrequirements.txt
(regardless of what is stated in that project’s repository) and I’m cautious about adding an option to pip that is specific to another project (will we then get requests to add an option for Poetry’s lock file format?)At a minimum, I’d like to see some discussion within the community that resulted in agreement that
pipenv.lock
was a standard format, before adding this (and in particular, I’d like the poetry devs to have bought into that agreement).There’s discussion about a standard lock file format: https://discuss.python.org/t/structured-exchangeable-lock-file-format-requirements-txt-2-0/876