python-poetry / python-poetry/poetry

Configuration option to force use of system site-packages

Open
#1,945 19 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/venv kind/feature
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

We need a way to tell poetry to ignore the currently active virtual environment. I am running into a roadblock trying to automate some of the poetry install operations from python.

As a comparison, pipenv supports it through the PIPENV_IGNORE_VIRTUALENVS environment variable.

The best approach, I think, is a switch like --breakout-of-venv (can't find a good name) to tell poetry to ignore the currently activated environment for any command that needs to deal with the virtual environment (install, add, remove...).

Other ideas:

  • It feels like poetry env is the right candidate for this. Something like poetry env use --default maybe. But then you always need 2 commands per poetry command if you're using e.g. subprocess.call() to make it work; only useful in a real CLI context.
  • A poetry config could work, but it sounds weird to modify this in order to run a script.
  • An env variable -only solution like pipenv does is cumbersome and annoying to use, but having the option to do it is useful for CI servers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Poetry's install, add, remove, and env commands choose an environment, then compare the requested behavior with PIPENV_IGNORE_VIRTUALENVS. Determine whether the completed change should be a switch, configuration setting, or environment variable, and verify that activated virtual environments are ignored for the affected operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.