Skip to content

docs: clarify env use precedence over active virtualenvs#10985

Open
xu430 wants to merge 2 commits into
python-poetry:mainfrom
xu430:docs-clarify-env-use-precedence
Open

docs: clarify env use precedence over active virtualenvs#10985
xu430 wants to merge 2 commits into
python-poetry:mainfrom
xu430:docs-clarify-env-use-precedence

Conversation

@xu430

@xu430 xu430 commented Jul 17, 2026

Copy link
Copy Markdown

Document that an explicit poetry env use selection (via envs.toml) wins over a shell-activated VIRTUAL_ENV, and how to reset with poetry env use system.

Pull Request Check List

Resolves: #8247

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

Document that an explicit `poetry env use` selection (via envs.toml) wins over
a shell-activated VIRTUAL_ENV, and how to reset with `poetry env use system`.

Fixes python-poetry#8247

Co-authored-by: Xu Mingxuan <207414859+xu430@users.noreply.github.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The explanation of precedence between poetry env use and VIRTUAL_ENV is currently split between the ordered list and the later note; consider consolidating or cross-referencing these to avoid repetition and keep the behavior description in one place.
  • When referring to the “virtualenvs cache” and envs.toml, it may help to briefly clarify how a user can locate or inspect that file (e.g., via poetry config virtualenvs.path or a short pointer) so the reference is immediately actionable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The explanation of precedence between `poetry env use` and `VIRTUAL_ENV` is currently split between the ordered list and the later note; consider consolidating or cross-referencing these to avoid repetition and keep the behavior description in one place.
- When referring to the “virtualenvs cache” and `envs.toml`, it may help to briefly clarify how a user can locate or inspect that file (e.g., via `poetry config virtualenvs.path` or a short pointer) so the reference is immediately actionable.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Keep precedence in one place, and point readers to
`poetry config virtualenvs.path` for locating envs.toml.

Co-authored-by: Xu Mingxuan <207414859+xu430@users.noreply.github.com>
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.

"Managing environments" confusing documentation about honoring current virtual environment

1 participant