-
Notifications
You must be signed in to change notification settings - Fork 124
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
dist/
in .gitignore
makes wheel empty
#320
Comments
Poetry uses the .gitignore to decide what to include. When it's building from SDist, I have a feeling it's detecting that it's in a git repository? @FFY00 Why are we not building in an isolated temporary directory? In #304, they are being placed in As a temporary workaround, @Andrew-Sheridan, you can set |
@henryiii Thanks for the response. Please doublecheck what I typed is actually accurate when you are able, it's possible I have made some simple error. |
The rationale was that I wanted to provide the source on the failed build for users to easily inspect and try to reproduce the issue. Given the issue presented here, I believe we should do it in an isolated temporary directory. I'd want build systems to be smart enough to notice they are being invoked inside the directory that is in the |
Fixes pypa#320 Signed-off-by: Filipe Laíns <[email protected]>
If we chdir into the unpacked sdist then why does Poetry try to read the git ignores from the project root? Does it mean that it'll do that for any Poetry sdist you happen to build inside your project, so that if you ignore "foo" in your project's repo and a downloaded sdist contains a package "foo", "foo" won't be packaged in the wheel? Poetry should be passing |
I think it's querying git, not .gitignore directly. If the project root was not at the top level (which is not uncommon), you still want to use git's ignore scheme (including the project root .gitignore) in seeing if anything is ignored. For example, if your package is in The problem is that everything is in /dist, and poetry asks git, and git says everything in dist is being ignored. |
That will break this functionality when the package is not at the root of the repo. |
I don't understand what will break? The "project root" here is the unpacked sdist folder. |
If I have a git repo with packages in subdirectories, hardcoding the .git path based on the python project root will break the vcs files detection because the git repo does not live there. |
Then they might want to consider disabling gitignore detection for sdists, e.g. if |
Perhaps, but some other backends will inevitably run into this same issue again, so we can't do anything about it. |
Hello
build
maintainers.tl;dr As of
build==0.5.0
, if.gitignore
hasdist/
in it, then the wheel created will be mostly empty.Below are steps to recreate
Create files
Init git / activate python / install build
Build (working)
prints
lib_name
, andls org/lib_name
prints__init__.py
Build (not working)
prints
ls: org: No such file or directory
And working with 0.4.0
prints
lib_name
, andls org/lib_name
prints__init__.py
🤷🏻♂️
The text was updated successfully, but these errors were encountered: