Activate `requires-plugins` from a project without using `poetry install`
Issue Kind
Change in current behaviour
Description
I have a use case where I currently copy the pypoetry.toml and poetry.lock files into a docker container and then run poetry export. In order to install the export plugin, I looked at using the tool.poetry.requires-plugins section, but it looks like that's only checked when the project is installed. It'd be nice if there was a way to ensure all required project plugins were installed without installing the project itself. That could either be a new command or maybe poetry self install could be changed to install project plugins as well.
Impact
This would improve the flexibilty of the tool.poetry.requires-plugins configuration option.
Workarounds
I worked around the issue by installing poetry-plugin-export explicitly in my dockerfile, but it'd be nice if there was a more generic way to accomplish this.
Maybe poetry install --no-root is the answer to your issue? I don't think we can install plugins without installation.
I think I have the same request. I have a project with a CI job that requires use of poetry-plugin-export to run poetry export, and I want that plugin/command to be available without installing all of the project's requirements. I basically want to tell poetry "please install the plugins declared in pyproject" and see only those plugins installed. So far, I have not found solution other than explicitly invoking poetry self add poetry-plugin-export, but I don't like this redundancy.
poetry install --no-root does not solve this problem; that still installs all the project's requirements.
So, you would want something like poetry install --only-plugins?
Yeah, I think that's exactly what I'm looking for.
My CI job broke and I landed here. Would be nice to have this!
My CI job broke and I landed here. Would be nice to have this!
For another perspective, I use poetry to export to requirements.txt in a Dockerfile so that I can use sam build (which sadly only supports requirements.txt). Previously, this could be achieved by copying over the pyproject.toml and poetry.lock files and then running poetry export. Now, poetry install has to run before poetry export can be used which means waiting for everything and plugins to install even though only the plugins are needed.
@Secrus Do you have any timeline for implementing the requested feature?
For anyone running into the case, I suggest using poetry install --dry-run as a work around — it's exactly a more verbose version of a plugin-only installation, despite its original intention to be a dry run.
This has come up in #10043 and was previously tracking this as it related to #6154. I would like this for poetry-git-version-plugin. Maybe someone else here can answer what is the right workflow for building?
Historically we've ensured poetry was installed and just called build. Should we be calling poetry install