-
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
Inconsistent handling of include / exclude for sdist and wheel #8994
Comments
this difference is per the docs, or anyway it will be in the upcoming release - #8852 please close |
I'm not convinced that that is the same issue, or even that the new documentation is correct. In our case If this was the issue, then I would expect the following include = [{ path = "src/fondant/components/**/*.yaml", format = ["sdist", "wheel"] } ]
exclude = ["src/fondant/components"] But the result is unchanged. |
This seems closer related to #7153.
|
#7153 shows no bug and should be closed when you say that you want to include |
I do think #7153 shows a bug, as do other users based on the comments. Poetry's behavior is currently inconsistent:
|
if you want to argue about #7153, please do it in that issue as we started: that include applies differently to sdist and wheel is known and documented I don't know whether you've found a new wrinkle where saying "exclude" activates the "include" or something like that, maybe. Feel free to experiment and tease out what is going on, and even submit a pull request: the code is round about here |
You're right. I did not find that issue before opening this one. I will move the discussion there, but would appreciate it if you could actually look into the arguments provided by myself and other users, or at least providing your own clear argumentation instead of being dismissive.
The documented difference is not correct though. It says that |
In the other one, you asked me to confirm that this one is a bug. (Aside: can we please discuss issue X in issue X, and issue Y in issue Y?) I don't think there's a definitive answer, sorry. I don't understand exactly what the code is doing, why it is doing that, or whether it was intended to do that. If you're able to propose a definite improvement, I assume maintainers would be open to accepting it. |
The new packaging strategy introduced in #849 doesn't work correctly for wheels due to a bug in poetry (python-poetry/poetry#8994), which breaks installing both from Github and PyPi. This PR introduces a workaround. Since the bug is related to the `src` directory, this workaround adds a `pre-build/sh` script which unpacks the `src` directory before building, and a `post-build.sh` script which moves the package back into the `src` directory afterwards. This leads to the following result: - Installing from Github leads to an installation including all component files - Installing locally without running the build script leads to an installation including all component files - Installing from PyPi leads to an installation with only the `fondant_component.yaml` files for each component In the ideal case, we get the same result for all installation methods, but this already at least leads to a working result for each method.
Superseded by #9691 |
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.Issue
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
fondant_component.yaml
file from each component insrc/fondant/components
and ignore all other files.I tried to do this with the following
include
/exclude
in ourpyproject.toml
:So excluding the full directory, and including the specific files we do want to package.
However this leads to inconsistent results in the
sdist
andwheel
outputs:sdist
This is the result we want to achieve.
wheel
As a reproducible example, you can run
poetry build
from the root of our repo.I've tried different things to achieve this result:
exclude
glob:but none of them worked.
The difference in behavior of
include
/exclude
between sdist and wheel seems like a bug to me, but we would also be interested in a workaround to achieve what we are looking for.The text was updated successfully, but these errors were encountered: