Having `from` with multiple packages will use last `from` for all of them
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name:
python:3.7
Docker image -
Poetry version: 1.0.0
Issue
If there is more than one package in packages
with from
set, the last one will be used for all. Even worse, packages without from
will also be attempted to be resolved inside the last from
directory.
So with:
packages = [
{ include = "apple" },
{ include = "pear", from="pear_tree" },
{ include = "orange", from="orange_tree" },
]
Poetry will try to resolve both apple
and pear
from inside orange_tree
as far as I observed from debug output.
If it’s a known limitation that using from
only one package should be defined then the docs (at https://python-poetry.org/docs/pyproject/#packages) should definitely mention it as I was stumped by it for hours.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (1 by maintainers)
Top GitHub Comments
Oops, I see that when I initially posted the simple reproducer for this, I left off the URL for the tarball containing the reproducer. That’s fixed now.
I saw that in develop branch there’s been some changes to
install
which could be relevant. I tested the reproducer against that. The good news is that install now completes successfully. The bad news is that it didn’t do the right thing.poetry install for this test case generates a fruit.pth that points to the toplevel dir:
But neither of the packages in the test case reside in the toplevel dir. They reside in the subdirs, /var/tmp/fruit/src and /var/tmp/fruit/lib. So there needs to be two new pth entries, one for each of those.
Poetry hash on the develop branch which I tested: abee30f07c8351ad19b2830d1c8605b97be2c58a
If I understand correctly the code that is causing this issue is https://github.com/python-poetry/poetry-core/blob/master/poetry/core/masonry/builders/sdist.py#L134-L135
I was tinkering around with something like this
but this is also not doing the right thing. I have to admit I know to little about setuptools to understand what is the correct way to go here.