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

poetry build not respecting git's ignore patterns when -f is specified #2910

Closed
skgbanga opened this issue Sep 12, 2020 · 2 comments · Fixed by python-poetry/poetry-core#81
Closed
Assignees
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/bug Something isn't working as expected status/waiting-on-core Requires changes to poetry-core first
Milestone

Comments

@skgbanga
Copy link

Hello,

I am on the latest poetry version (1.0.10) on a rhel7 box, and noticed a bizarre behavior related to poetry build.
Consider this simple project structure: (available at: https://github.com/skgbanga/Sandbox/tree/master/python/package)

$ tree -a
.
├── pyproject.toml
└── src
    └── mypackage
        ├── __init__.py
        ├── lib64
        │   └── something.so
        └── sample.py

Running poetry build -vvv on this results in:

$ poetry build -vvv 
Using virtualenv: ...
Building mypackage (0.1.0)
 - Building sdist
 - Adding: src/mypackage/__init__.py
 - Adding: src/mypackage/sample.py
 - Adding: pyproject.toml
 - Built mypackage-0.1.0.tar.gz

 - Building wheel
 - Adding: /tmp/tmptez5tyvj/mypackage-0.1.0/src/mypackage/__init__.py
 - Adding: /tmp/tmptez5tyvj/mypackage-0.1.0/src/mypackage/sample.py
 - Built mypackage-0.1.0-py3-none-any.whl

As you can see, it didn't package lib64/something.so.
This is okay because the documentation here says that:

If a VCS is being used for a package, the exclude field will be seeded with the VCS’ ignore settings (.gitignore for git for example).

My .gitignore does contain this section.

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

Now, consider this invocation

$ poetry build -vvv -f wheel
Using virtualenv: ...
Building mypackage (0.1.0)
 - Building wheel
 - Adding: ... src/mypackage/__init__.py
 - Adding: ... src/mypackage/lib64/something.so
 - Adding: ... src/mypackage/sample.py
 - Built mypackage-0.1.0-py3-none-any.whl

It now has packaged something.so when my understanding of the documentation says that it shouldn't have done so.

@skgbanga skgbanga added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 12, 2020
@finswimmer
Copy link
Member

Hello @skgbanga,

thanks a lot for reporting. I can confirm this and have already found the cause of this issues (the src-layout). Let's see if I can fix it the next days.

fin swimmer

@finswimmer finswimmer added area/build-system Related to PEP 517 packaging (see poetry-core) and removed status/triage This issue needs to be triaged labels Sep 14, 2020
@finswimmer finswimmer self-assigned this Sep 14, 2020
@abn abn added the status/waiting-on-core Requires changes to poetry-core first label Sep 23, 2020
@abn abn reopened this Sep 23, 2020
@abn abn added this to the 1.1 milestone Sep 23, 2020
Copy link

github-actions bot commented Mar 3, 2024

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 Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/bug Something isn't working as expected status/waiting-on-core Requires changes to poetry-core first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants