-
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
Having from
with multiple packages will use last from
for all of them
#1811
Comments
Hello @daaain , could you please provide a full minimal example of the folder structure and the Thanks a lot 👍 fin swimmer |
EDIT: I think this is a different bug but would probably be masked if this bug didn't exist. I'll open a different bug report for this but also generate a different minimal reproducer that applies to this bug.
|
Perhaps also of help:
|
Looks like the temporary setup.py that is generated has:
So that is wrong, at least. |
I started using poetry so I could forget everything I ever knew about setuptools and distutils ;-) but I think that the
It's a bit late here so I may not be thinking clearly (and I know there are subtle ways to get |
Okay it's morning and I wonder if there's two bugs here and my example is running across both of them while the original poster is only running across one of them. In my example, one of the two things listed in include is not a package ( So I think the bug in my case is that the generated setup.py puts
The original reporter, however, did not use |
Okay, minimal reproducer for this bug:
here's the relevant section from the setup.py that poetry generates for the install case:
I believe for this bug,
where the python package that matches the sdist name is what is present in
(I'll take the other case to a different bug report. |
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 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: abee30f |
I am running into the same problem on a project. Admittedly it is a rare use case to have a split project structure with multiple packages, but it would be super nice if this was supported. |
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 if pkg_dir is not None:
package_dir[include.package] = os.path.join(
os.path.relpath(pkg_dir, str(self._path)),
include.package
) 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. |
When we define multiple packages from different source locations, Poetry currently only uses the last specified from=. This patch adds explicit paths to package_dir for any additional packages. This fixes python-poetry/poetry#1811, python-poetry/poetry#2354 And possibly python-poetry/poetry#2450
When we define multiple packages from different source locations, Poetry currently only uses the last specified from=. This patch adds explicit paths to package_dir for any additional packages. This fixes python-poetry/poetry#1811 python-poetry/poetry#2354 And possibly python-poetry/poetry#2450
When we define multiple packages from different source locations, Poetry currently only uses the last specified from= location. This patch adds explicit paths to package_dir for additional packages. This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354, and possibly even python-poetry/poetry#2450.
When we define multiple packages from different source locations, Poetry currently only uses the last specified from= location. This patch adds explicit paths to package_dir for additional packages. This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354, and possibly even python-poetry/poetry#2450.
When we define multiple packages from different source locations, Poetry currently only uses the last specified from= location. This patch adds explicit paths to package_dir for additional packages. This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354, and possibly even python-poetry/poetry#2450.
* Fix for including modules from different locations When we define multiple packages from different source locations, Poetry currently only uses the last specified from= location. This patch adds explicit paths to package_dir for additional packages. This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354, and possibly even python-poetry/poetry#2450. * Test the fix for including modules from different locations When we try to include moduleA from libA and moduleB from libB then package_dir in the generated setup.py must to contain either one or both `"moduleA": "libA/moduleA"` or `"moduleB": "libB/moduleB"` so we are able to find both modules when building the source dist. `ns["package_dir"].keys() == {"", "module_b"}` should always be true, so we don't have to test for module_a in `ns["package_dir"]`.
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. |
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 imagePoetry version: 1.0.0
Issue
If there is more than one package in
packages
withfrom
set, the last one will be used for all. Even worse, packages withoutfrom
will also be attempted to be resolved inside the lastfrom
directory.So with:
Poetry will try to resolve both
apple
andpear
from insideorange_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.The text was updated successfully, but these errors were encountered: