Is there a way to specify PIPENV_VENV_IN_PROJECT in a Pipfile? Adding an empty directory to source control is not universally supported, and dropping a .venv/README.txt or something similar to force creation of the directory seems unfortunate.
No, this has been discussed in the past. It really does not make sense because the virtualenv location is a personal preference, not a project preference. There is little reason (as far as I can see) to force others into using the same config.
That depends very much on the project and other tooling required, doesn't it?
I'll certainly live with the answer being "no", but disagree that it never matters.
I agree this may not be impossible, but, well, let鈥檚 say I will try to make a very strong argument against this requirement if I ever need to be involved in such a project.
We have discussed this in the past -- it is definitely something we want to keep as a user level setting (unless there is a virtualenv in the project directory)
For the lurkers, here are some related issues:
PIPENV_VENV_IN_PROJECT
in .env
, but this doesn't work: https://github.com/pypa/pipenv/issues/2313 and https://github.com/pypa/pipenv/issues/1210.pipenv.cfg
https://github.com/pypa/pipenv/issues/2778Things you can do:
.venv
yourself. Pipenv will use it. direnv
to activate this setting per directory.venv
whose contents are only the path to the root directory of a virtualenvFor points 1 and 4, pipenv will pick this up automatically
For what it's worth, what I eventually came up with was a script to build a .deb for my project, using a virtualenv created by pipenv as fodder.
To build, my script moves aside any existing pipenv-managed venv and let's pipenv create a new one (at whatever location it happens to choose). The lib/pythonX.Y/site-packages directory is then used as a component to create the raw input for dpkg-deb (which does not contain a venv). The application package then depends on a clean, non-system Python installation.
Most helpful comment
Things you can do:
.venv
yourself. Pipenv will use it.direnv
to activate this setting per directory.venv
whose contents are only the path to the root directory of a virtualenvFor points 1 and 4, pipenv will pick this up automatically