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

Always create virtual env if virtualenvs.force-create is True #9902

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasondamour
Copy link

Pull Request Check List

Resolves: #4055

  • Added tests for changed code.
  • Updated documentation for changed code.

@radoering
Copy link
Member

As it is implemented, when virtualenvs.force-create is set:

  • Poetry still uses an existing in-project .venv (and does not create a new venv) if virtualenvs.in-project is not set to false. That is probably fine.
  • If virtualenvs.create is set to false, the system env will be used. No venv will be created. Not sure if that makes sense.

@finswimmer Pinging you since you have done some refactoring of the env management recently. What do you think of such an option, especially in combination with the existing options, cf #4055 (comment).

As an alternative to a new option we could also allow the value "force" for virtualenvs.create. Then, we do not have to think about combinations like virtualenvs.create = false and virtualenvs.force-create = true.

After having decided what exactly this option should look like, we definitively need some tests and docs.

@jasondamour
Copy link
Author

jasondamour commented Dec 14, 2024

@radoering thanks for the quick (weekend) review! I agree with you on everything.

As an alternative to a new option we could also allow the value "force" for virtualenvs.create.

I thought about this too, and decided against it to make it appear "safer*" to merge. But if the maintainers agree with it, I prefer "force" as a value too, and I'll implement that instead.

Additionally, I would like to see this released in 1.X, is there anything I need to do regarding the branch to do that?

@radoering
Copy link
Member

Additionally, I would like to see this released in 1.X, is there anything I need to do regarding the branch to do that?

There are no plans for another 1.X feature release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to force Poetry to create a virtual environment, even if a virtual env is active
2 participants