[Python] My python project that requires a plugin that I also wrote fails on poetry install...

Discussão em 'Python' iniciado por Stack, Julho 23, 2025.

  1. Stack

    Stack Membro Participativo

    I am using the following versions:

    Poetry (version 2.1.1)
    Python 3.13.2
    pip 25.0.1 from <correct path to the pip location in venv>


    I have written an application plugin for poetry. That project has a section in the pyproject.toml file like this:

    [project]
    name = "mycoolplugin"
    version = "1.0.0"
    ...
    [tool.poetry.plugins."poetry.application.plugin"]
    mycoolplugin = "mycoolplugin:CoolPlugin"


    It builds and creates the expected wheel. I can run and test its commands in that project and during tests run by pytest.

    In the project that I want to use the plugin the pyproject.toml file contains:

    [tool.poetry.requires-plugins]
    mycoolplugin = ">=1.0.0"


    I have not yet published the plugin to the company pypi site since I am still testing this. So, I am trying to do a manual install.

    Once I create the venv eval $(poetry env activate 2>/dev/null). Which is where I get the version list above. I try to install the plugin with pip install ../mycoolplugin/dist/mycoolplugin-1.0.0-py3-none-any.whl Now pip list shows my plugin there with a version of 1.0.0

    However poetry install

    poetry install
    Removing the project's plugin cache because it is outdated
    Ensuring that the Poetry plugins required by the project are available...
    The following Poetry plugins are required by the project but are not installed in Poetry's environment:
    - mycoolwplugin (>=1.0.0)
    Installing Poetry plugins only for the current project...
    Updating dependencies
    Resolving dependencies...

    Because poetry-project-instance depends on mycoolplugin (>=1.0.0) which doesn't match any versions, version solving failed.


    Trying to add it to poetry also fails:

    poetry add mycoolplugin

    Could not find a matching version of package mycoolplugin


    The most confusing thing is I had this working at some point and was doing some testing and deleted all the built binaries to start clean and started seeing this. I don't see what I am missing names match up, versions match up pip install commands succeed.

    Two additional notes:

    1. yes I changed the name of the plugin since the company I work for will not allow even names to leak out.
    2. Both projects pull dependencies form an internal pypi mirror specified thusly:

    [[tool.poetry.source]]
    name = "company-pypi"
    url = "https://artifactory.company.com/api/pypi/pypi.python.org/simple"
    priority = "primary"


    What is going on? Why doesn't poetry find the plugin when it is available in pip locally? Is it really complaining about version mismatch or is it really unable to find it? What can I do to fix this?

    Continue reading...

Compartilhe esta Página