Skip to content

Skip plugin loading for version output - #10992

Open
pratyushsinghal7 wants to merge 2 commits into
python-poetry:mainfrom
pratyushsinghal7:fix/version-plugin-loading
Open

Skip plugin loading for version output#10992
pratyushsinghal7 wants to merge 2 commits into
python-poetry:mainfrom
pratyushsinghal7:fix/version-plugin-loading

Conversation

@pratyushsinghal7

Copy link
Copy Markdown

Pull Request Check List

Resolves: #10625

  • Added tests for changed code.
  • Documentation is not required for this internal startup optimization.

Summary

Skip application plugin discovery when Poetry is invoked with the global --version or -V flag. Plugins cannot change Poetry's version output, and loading their entry points adds avoidable startup latency.

The check lives in _load_plugins() alongside the existing --no-plugins fast path. It uses Cleo's parameter boundary handling so version arguments forwarded to subprocesses, such as poetry run -- python -V, continue to load Poetry plugins normally.

Testing

  • .venv/bin/pytest tests/console/test_application.py -q — 22 passed
  • PATH="/tmp/poetry-test-bin:$PATH" .venv/bin/pytest tests/console -q — 958 passed, 6 skipped
  • PATH="/tmp/poetry-test-bin:$PATH" .venv/bin/pytest -q — 3176 passed, 27 skipped
  • .venv/bin/mypy — success across 374 source files
  • .venv/bin/pre-commit run --files src/poetry/console/application.py tests/console/test_application.py — passed

@pratyushsinghal7
pratyushsinghal7 marked this pull request as ready for review July 24, 2026 05:16

@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 reviewed your changes and they look great!


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.

Comment thread src/poetry/console/application.py
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.

poetry --version is slower than it could be

2 participants