Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I specify PIPENV_VENV_IN_PROJECT in Pipfile? #2197

Closed
freddrake opened this issue May 15, 2018 · 7 comments
Closed

Can I specify PIPENV_VENV_IN_PROJECT in Pipfile? #2197

freddrake opened this issue May 15, 2018 · 7 comments
Labels
Type: Duplicate This issue is a duplicate of an already-existing issue.

Comments

@freddrake
Copy link

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.

@uranusjr
Copy link
Member

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.

@uranusjr uranusjr added the Type: Duplicate This issue is a duplicate of an already-existing issue. label May 15, 2018
@freddrake
Copy link
Author

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.

@uranusjr
Copy link
Member

I agree this may not be impossible, but, well, let’s say I will try to make a very strong argument against this requirement if I ever need to be involved in such a project.

@techalchemy
Copy link
Member

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)

@Flimm
Copy link

Flimm commented Dec 10, 2018

For the lurkers, here are some related issues:

@techalchemy
Copy link
Member

Things you can do:

  • Simply create the .venv yourself. Pipenv will use it.
  • Use a tool like direnv to activate this setting per directory
  • Set the envvar globally
  • Create a file in the project root called .venv whose contents are only the path to the root directory of a virtualenv

For points 1 and 4, pipenv will pick this up automatically

@freddrake
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Duplicate This issue is a duplicate of an already-existing issue.
Projects
None yet
Development

No branches or pull requests

4 participants