-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
How can I ignore the 'VIRTUAL_ENV' environment variable? #281
Comments
@jacebrowning, run poetry while unsetting
Now even though you are "Inside" an virtual environment, poetry won't know about it. |
@bertjwregeer Thanks for the tip. This actually results in the same behavior, but for a different reason. Given this part of the Travis CI configuration:
|
That's most definitely a bug! |
I filed that here: #286 |
I am running into a related problem. I have |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue
In my projects, I create the virtual environment in the project root (
$ poetry config settings.virtualenvs.in-project true
) so that I can explicitly manage dependencies and cache them between builds.Travis CI runs builds inside of its own virtual environment (thus sets
VIRTUAL_ENV
).The current logic consults
VIRTUAL_ENV
before any other settings: https://github.com/sdispater/poetry/blob/ae1773d68f341c34d9124353f7a952d5fd3cfefb/poetry/utils/venv.py#L47-L50How can I tell
poetry
to ignoreVIRTUAL_ENV
and always create a virtual environment?pipenv
gets around this by adding another environment variable (PIPENV_IGNORE_VIRTUALENVS
). but I thinkpoetry
can do better.Proposal A
The default value of
settings.virtualenvs.create
is inferred fromVIRTUAL_ENV
(false
if set,true
if unset).If the user runs
$ poetry config settings.virtualenvs.create true
thenpoetry
will always create a virtual environment irrespective ofVIRTUAL_ENV
.Proposal B
Add
settings.virtualenvs.ignore-active
to ignoreVIRTUAL_ENV
when creating a virtual environment.Proposal C
If
settings.virtualenvs.in-project
is set and./.venv/
does not exist thenVIRTUAL_ENV
is ignored.The text was updated successfully, but these errors were encountered: