-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative Source Definitions Within Path Dependencies Are Not Used #6728
Comments
This is currently by design. You are essentially encountering the boundary of the "Poetry-only" world and the wider Python packaging ecosystem. Poetry is actually an interoperable tool that is compatible (or strives to be) with the rest of the Python packaging ecosystem. We have cross-tool standards like PEP 517 so that you can consume Poetry packages (or have Poetry consume other packages) regardless of the tooling on the other end. Now, it's true that Poetry does not use the PEP 517 API to build other projects that use Poetry when they are path dependencies -- however, we have, up until this point, attempted to avoid introducing magical behaviors around this that violate what is possible with a purely PEP 517-driven interaction. Namely, a PEP 517 build system outputs a list of requirements to the caller, but does not install the requirements, or communicate information on how they are installed in the dependency itself. Now, if you specify It seems like what you are looking for is better support for monorepos/workspaces/subprojects, where path dependencies are explicitly allowed to be 'Poetry-aware' and we can 'leak' information across the larger project hierarchy, in ways that would otherwise be surprising and undesirable. That is tracked in #2270 -- and there is a user working on introducing this into Poetry sooner than later, though we have yet to do any rigorous review of the design or code. In short, this is intended and part of how the Python packaging world works -- hopefully that explanation makes sense, and you know where future work is going/how you can help shape it, if you are interested. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option) and have included the output below.Here is my debug mode output
Issue
This relates to installing path-dependencies which use non-pypi sources for its dependencies. I try to describe the issue in this repo (the same as what's mentioned above for the pyproject.toml prompt).
Setup
I have a project that contains a package I developed within it, structured as below:
The
pyproject.toml
file within./my_package
specifies a non-pypi dependency using[[tool.poetry.source]]
.I specify
my_package
as a path dependency in the project's (top-level)pyproject.toml
. When I runpoetry install
from the project's directory, I expectmy_package
to install it's non-pypi dependencies with the sources defined in it'spyproject.toml
. But this fails with the following error:Workaround (ish)
However, when I define the same non-pypi
[[tool.poetry.source]]
in the project's (top-level)pyproject.toml
, everything installs as expected. This leads me to believe that poetry does not use sources defined in a path-dependency'spyproject.toml
, but only uses the sources defined in the top-levelpyproject.toml
when installing the dependencies of a path-dependency.This seems like a bug because a project should be agnostic towards the non-pypi sources used by its dependencies.
The text was updated successfully, but these errors were encountered: