-
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
Poetry created wheel puts includes into root of site-packages folder & is missing included folders. #7153
Comments
including files that you have told poetry to include is not a bug. The fix is simply: don't do that. not including tests in wheels is normal. please close. |
They are being included in the WRONG PATH in the wheel. That is the bug. If I specify to include the tests folder in the wheel, it should get included. Because I asked it to. But it does not. That is also what I'd call a bug -- it doesn't do what I asked. |
CHANGELOG etc are not being put in the wrong path: that's how you've laid out your project and that's what you've told poetry to include. Neither poetry nor I can guess what else you might have intended. (Probably you ought to include these files only in the sdist, which would make sense.) As for the tests: I now see you have tried to include a whole directory, but that's not how that works. You should include Edit: or, judging by include = [{ path = "tests", format = "sdist" }] Please close. |
Why would they be put in a different path in the wheel compared to the sdist then? They are being put into the root of site-packages when included in the wheel, which is generally a bad thing? Edit to clarify: when part of the sdist, they get put inside the pytest_shell_script_test_harness/ folder, not the root of site-packages.
Acknowledged. |
that is the equivalent top-level part of the project tree in the sdist: adjacent to Perhaps you are misreading the wheel. The |
I originally opened #8994, but that seemed to be a duplicate of this issue, so I will repeat the relevant info here.
When building our package, we want to include only yaml files and ignore all other files from a certain subdirectory. The relevant part of our file tree looks like this:
See our full file tree in our repo, the relevant directories and files are called the same. We only want to include the I tried to do this with the following include = ["src/fondant/components/**/*.yaml"]
exclude = ["src/fondant/components"] So excluding the full directory, and including the specific files we do want to package. However this leads to inconsistent results in the sdist
This is the result we want to achieve. wheel
As a reproducible example, you can run I've tried different things to achieve this result:
but none of them worked. Poetry's behavior is currently inconsistent:
|
I think that you are muddying the waters: what is described by this issue report is just not a bug: this issue really should have been closed what you have found is at least different, you have extra complications with src layout and with "exclude", it's not clear to me whether it's a bug or not IMO the right admin here is to track your thing in the issue that you have just closed - where per my last I invite you to look at the code and figure out what is going on / contribute a fix. |
I do think my issue is a different manifestation of the same underlying issue, but I will reopen it. I would appreciate if you could confirm that it is a bug before I dive into an unknown code base. I have provided a detailed description with only the relevant parts of the issue, and you can pull and build our public code base with two commands to reproduce it. |
Apologies for that. If it's not possible to do either of those, I would request the ability to alter the target location of an included file. TY |
Seems like it is (will be in 1.8) only possible for package includes but not for general includes. |
Doh. I'd need it for general includes. |
I need this too. This is very annoying and yes, either I dont understand why you are saying this is not a bug... I end up with files clashing in my site-packages because one package wants to include a file (LICENSE) at the root of site-packages. This is not allowed by my package manager to avoid obvious file clashes between packages. I'm not the author of this package, only tring to create a package for the package manager I'm using, so I'm ok to say this is not a bug if there is a simple way to patch the broken pyproject.toml. I don't think I can drop the LICENSE file legally. if the owner wants it in the package it should be somewhere in the package... FTR, the package manager I'm writing a package for is gentoo's portage, and the problematic python project is pwmled, a dependency of homeassistant. |
@bassdr You do not need it for LICENSE files. Of course, LICENSE files should be put into the sdist and the wheel. However, in the wheel, they must not be put top-level but in the
You can tell them that these lines should be removed. The LICENSE file will still be included top-level in the sdist and in the |
-vvv
option) and have included the output below.Issue
When installing a wheel created by poetry and having specified
include=
inpyproject.toml
, the included files get extracted into the root of thesite-packages
folder.Steps:
Alternative Steps for Verification:
Results:
Expected:
sdist result:
wheel result:
NOTE: 'tests' folder missing from wheel
The text was updated successfully, but these errors were encountered: