Open ncoghlan opened 6 years ago
I can't wait for the support for Pipfile
/ Pipfile.lock
to be implemented in pip
itself. I may stick to pyenv
, instead of pipenv
in the near future, due to the simplicity and comfort the pyenv
provides (mainly using the .python-version
file). In addition, it seems that the issues of managing the versions of Python and managing packages dependencies are two separate topics, and Pipfile.lock
lies more in the sphere of pip
than Virtual Environments (I come from the Ruby world, where these issues are properly handled by RVM / rbenv and Bundler separately).
Do you have any roadmap, plan to add Pipfile.lock support to pip
(via the -p
flag)?
When can we expect it more or less?
You can also manage the python version in the Pipfile, though I agree it is a little weird if for example you are using tox for 2 and 3.x (eg 3.5/3.6/3.7/3.8) compatibility testing that you need to also use a specific package tox-pipenv to enable compatibility with the virtualenvs created by pipenv for Tox to test against multiple Python versions.
(@dstufft recently mentioned wanting to spend time on native
Pipfile
support inpip
after Warehouse launches and legacy PyPI is shut down, and that reminded me that I had some concerns regarding the proposed inclusion of lock file updating capabilities in https://github.com/pypa/pipfile#pip-integration-eventual)When managing the relationship between
Pipfile
andPipfile.lock
, there are two quite distinct ways of handling it:pip freeze
model)Pipfile
, then calculatePipfile.lock
based on that requirements set (thepip-compile
model)pipenv
uses the latter approach, and the fact that it ignores any extra packages installed directly withpip
is considered a feature, not a bug.If we move the
pipenv
approach down to thepip
layer, though, then things get a lot more complicated, as we have to ask whether or not we're going to makePipfile
mandatory in order to usepip
at all, and I don't think it makes sense for us to do that, for the same reason that we ended up keeping the "application dependency management with pipenv" tutorial separate from the core "package installation with pip" tutorial:Pipfile
doesn't really make sense as a model for managing user site-packages directories, and similar ad hoc personal environments.So at the
pip
layer, I think the "lock the current environment" model makes more sense than thepipenv
-style compilation model.However, I also think that that would be a confusing model to use implicitly, so I'm thinking that
Pipfile
support inpip
should look somewhat different from the way it looks at thepipenv
layer:pip install -p dirname
andpip install --project dirname
to handle directories containingPipfile
andPipfile.lock
, such thatpip install -p .
has the same semantics aspipenv install --deploy
(no implicit update, but refuses to install ifPipfile.lock
is out of date with respect toPipfile
). Note the suggested use of--project
as the long form of the option name (again reflecting the ad hoc installation vs project dependency management split that we introduced in the tutorials).pip install -p fname
to accept direct references toPipfile
formatted files as input (doesn't even check forPipfile.lock
in that case, sopip install -p Pipfile
is akin topipenv install --skip-lock
)pip install -p fname
to accept direct references toPipfile.lock
formatted files as input (doesn't even check forPipfile
in that case,pip install -p Pipfile.lock
is akin topipenv install --ignore-pipfile
)pip install -r fname
to acceptPipfile.lock
formatted files as input in addition to the existingrequirements.txt
format support (functionally equivalent topip install -p fname
, so this could be instead of the previous option, rather than in addition to it). The purpose of this would be to ease integration with other tools that pass along requirements files topip install -r
commands, but otherwise don't care about their internal format.pip freeze
with a-p/--project
option that emitted aPipfile
/Pipfile.lock
pair for the currently active virtual environment in the current working directory (where all thePipfile
dependencies would be"*"
deps, whilePipfile.lock
would have the exact versions)