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

Flag for PIPENV_VENV_IN_PROJECT #4489

Closed
cupcakearmy opened this issue Oct 14, 2020 · 4 comments
Closed

Flag for PIPENV_VENV_IN_PROJECT #4489

cupcakearmy opened this issue Oct 14, 2020 · 4 comments
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided.

Comments

@cupcakearmy
Copy link

cupcakearmy commented Oct 14, 2020

Is your feature request related to a problem? Please describe.

Installing pipenv in the current folder is a pain.
There is a trick that if you create a .venv folder before initializing pipenv it will install locally, but that's far from user friendly.
I don't share the opinion that envs should be outside the project as default, but that was discussed enough.
At least give us simple flag instead needing to setting env vars.....
Again, the "trick" with creating the .venv folder works like a charm, however it's implicit knowledge, as a new user to pipenv it's impossible to know. just bad DX. a flag is easily discovered with pipenv install --help

That said, I'm VERY grateful that python finally gets a way to manage dependencies in a sane manner.

Describe the solution you'd like

add a flag like --env-folder .venv .e.g. that the user can override the default path.
or simply --venv-in-project to stay consistent with the env variable.
Up to you really.

Describe alternatives you've considered

  • Setting the env variable
  • creating .venv folder manually

Edit: Feel free to close it if it was already discussed or there is another issue for that that I missed


(This exposes the username and other stuff if simply copied publicly....)

$ pipenv --support

Pipenv version: '2020.8.13'

Pipenv location: '/usr/local/Cellar/pipenv/2020.8.13_1/libexec/lib/python3.9/site-packages/pipenv'

Python location: '/usr/local/Cellar/pipenv/2020.8.13_1/libexec/bin/python'

Python installations found:

  • 3.8.6: /usr/local/bin/python3
  • 3.8.6: /usr/local/bin/python3.8
  • 3.8.2: /usr/bin/python3
  • 2.7.16: /usr/bin/python2
  • 2.7.16: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.9.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '19.6.0',
 'platform_system': 'Darwin',
 'platform_version': '***',
 'python_full_version': '3.9.0',
 'python_version': '3.9',
 'sys_platform': 'darwin'}

System environment variables:


Pipenv–specific environment variables:

Debug–specific environment variables:



@matteius
Copy link
Member

@cupcakearmy I think that the ability to specify where the virtualenvs live already exists in two forms:

Within pipenv you can specify that you want the virtualenv created within the project: PIPENV_VENV_IN_PROJECT Ref: https://pipenv.pypa.io/en/latest/basics/#pipenv-and-docker-containers

Unfortunately that feature may be under documented as I only found reference to it in that Docker containers section, but it is not specific to docker containers.

Many people use the virtualenvwrapper tool, which keeps all virtualenvs in the same place (the ~/.virtualenvs directory) and allows shortcuts for creating and keeping them there.

Ref: https://stackoverflow.com/questions/12184846/where-should-virtualenvs-be-created

All of that being said, I feel like your issue may be fulfilled by the existing options combined with the new functionality being proposed in: #4974 and #1226

If you agree please feel free to comment and close the ticket.

@matteius matteius added the Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. label Mar 16, 2022
@cupcakearmy
Copy link
Author

I think a flag in the cli would still be the way to go. Most people don't read docs to the end and mostly discover tools by using them. This means exploring what flags are available. I know it's not ideal but the reality 😉
Guess it's related to #2086.
Feel free to close if it's a wontfix

@matteius
Copy link
Member

@cupcakearmy While #4974 is currently proposing an environment variable, it is conceivable it could be also applied as a flag in the cli -- maybe you could coordinate with @darelf on the PR that is open to consider the most use cases?

@matteius
Copy link
Member

This was updated recently and the behavior is now:

Pipenv will now ignore .venv in the project when PIPENV_VENV_IN_PROJECT variable is False. Unset variable maintains the existing behavior of preferring to use the project’s .venv should it exist. #2763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided.
Projects
None yet
Development

No branches or pull requests

2 participants