Skip to content
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

Default for the include flag is sdist only, not sdist AND wheel #8698

Closed
1 task done
rdauncey53 opened this issue Nov 21, 2023 · 4 comments · Fixed by #8852
Closed
1 task done

Default for the include flag is sdist only, not sdist AND wheel #8698

rdauncey53 opened this issue Nov 21, 2023 · 4 comments · Fixed by #8852
Labels
area/docs Documentation issues/improvements

Comments

@rdauncey53
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

I was hitting a bunch of issues trying to include resource files in my Poetry build using the include key. It turns out that despite the docs saying that

If no format is specified, it will default to include both sdist and wheel.

It in fact seems to default to only sdist. The workaround was to change

include = "my_folder"

to

include = [
    { path = "my_folder", format = ["sdist", "wheel"] }
]

In addition to this, I find the documentation unclear / challenging in terms of understanding how to access these files when pulling the package in as a dependency. If the files aren't included in the module, I am struggling to get importlib.resources to work.

If it is required that files the package needs to access live inside the package folder, please could this be added to the documentation? If not, could you add some guidance on this?

@rdauncey53 rdauncey53 added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels Nov 21, 2023
@dimbleby
Copy link
Contributor

the best way to make docs changes happen is to submit merge requests!

your question about where files should live seems like more of a question about how python modules work at all, than about how poetry builds packages, I'm doubtful that poetry should take responsibility for documenting that.

@rdauncey53
Copy link
Author

rdauncey53 commented Nov 21, 2023

Fair enough - I think the reason for not making the change myself is because I don't know what the correct default behaviour should be. Happy to make the change myself if it is just change to "If no format is specified, it will default to include only sdist".

On the general Python questions, yes I agree this is largely outside of the Poetry remit. I think the poetry-relevant bit (which I admit I didn't make clear in my original post) is that Poetry will include those files in the site-packages folder upon Poetry install, which feels like a slightly odd design - I'm sure there is a good reason for that, but this behaviour isn't particularly well documented and makes working with the include flag difficult. I only figured things out because I found this (closed) Poetry issue.

@dimbleby
Copy link
Contributor

I assume that making the documentation match the code is uncontroversial and just a clear improvement: even if a later fix decides to change both.

If you or anyone else does think that it is the code that is wrong I suppose this is the relevant line

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants