shiv icon indicating copy to clipboard operation
shiv copied to clipboard

Accept pipenv's Pipfile.lock in place of pip's requirements.txt

Open JDLH opened this issue 2 years ago • 3 comments

When running shiv to build an app file, a good way to include all the other packages your app depends on seems to be to pass in the option, -r requirements.txt. The requirements.txt file is managed by pip. But I use pipenv in preference to pip. Pipenv lists dependencies in a file named Pipfile.lock.

I would like to have shiv accept Pipfile.lock in place of requirements.txt as a way to list all the packages which shiv should install into the app file.

JDLH avatar Jun 18 '22 04:06 JDLH

hi @JDLH,

I'm certainly open to supporting Pipefile.lock, however I lack direct experience with it (or pipenv, for that matter). My understanding is that pipenv is compatible with pip but not the other way around? For projects using Pipfile.lock would it make sense to use pipenv to stage the dependencies prior to packaging (similar to how shiv leverages pip today)?

lorencarvalho avatar Jul 09 '22 18:07 lorencarvalho

Thank you for the reply.

I added this issue as I was learning about shiv and about Python packaging. The underlying problem that I wanted to solve is that my environment managment tool, pipenv, was not communicating with my packaging tool, shiv.

Now I have read more of the Python Packaging User Guide, and I think there are better ways to solve the underlying problem than this. In particular, I just packaged another project where I listed all my dependencies in the pyproject.toml file. pipenv and shiv were able to communicate via that mechanism.

If it turns out that listing dependencies in pyproject.toml works robustly, then I am happy to use that, and drop this request. However, in that case there is (if I recall correctly) an issue that the shiv documentation does not describe well how to communicate dependencies via pyproject.toml.

JDLH avatar Jul 09 '22 19:07 JDLH

However, in that case there is (if I recall correctly) an issue that the shiv documentation does not describe well how to communicate dependencies via pyproject.toml.

Very true! I will leave this issue open to address the deficiencies in the current docs & close it once I've given them a once-through. Thanks!

lorencarvalho avatar Jul 11 '22 17:07 lorencarvalho