python-poetry / python-poetry/poetry
Check [tool.poetry.requires-plugins] on non-`install` commands
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
Issue Kind
Change in current behaviour
Description
Currently, the requirements in [tool.poetry.requires-plugins] are only checked (and ensured) when poetry install is run. I propose that poetry will check them on every non-self usage (poetry update, poetry add, etc.), and will print a warning if the plugins aren't installed.
These commands will also have a new flag --no-required-plugin that will skip this check (as a bonus, we could also add this flag to poetry install, which will allow users to skip both the checking and installation of required plugins)
I'm willing to make a PR for this if the proposal is accepted.
Impact
At our organization, we'd like to make use of [tool.poetry.requires-plugins] in our projects to enforce the use of our in-house plugin, but it's currently problematic for two reasons:
- The requirement is only checked during
poetry install, but the plugin is only actually needed forlock/add/updatecommands. This means that developers might clone a repo, and runpoetry update, without having the plugin installed. - Installing the required plugins is, AFAICT, mandatory when you use
poetry install. This means that users that don't necessarily need the plugin (CI pipelines, docker builds), must still install it.
The proposed change will address both these issues.
Workarounds
Our current workaround is to simply not use [tool.poetry.requires-plugins], and to ensure all our devs install the required plugins.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how Poetry handles required plugins for install, then compare the command entry points for update, add, and other non-self commands. Define which commands check or install plugins, how the --no-required-plugin flag applies, and when warnings are emitted. Done means the proposed behavior is covered consistently without affecting self commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100