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

Exclude Include combination gives wrong results #4711

Closed
3 tasks done
nylocx opened this issue Nov 5, 2021 · 5 comments · Fixed by python-poetry/poetry-core#228
Closed
3 tasks done

Exclude Include combination gives wrong results #4711

nylocx opened this issue Nov 5, 2021 · 5 comments · Fixed by python-poetry/poetry-core#228
Assignees
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/bug Something isn't working as expected

Comments

@nylocx
Copy link

nylocx commented Nov 5, 2021

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Arch Linux x64 Kernel 5.14.15
  • Poetry version: 1.1.11 and 1.2.0a2
  • Python version: 3.9.7
  • Link of a Gist with the contents of your pyproject.toml file: pyproject.toml

Issue

To setup a reproducible environment just run:

poetry new poetry-cython-demo
cd poetry-cython-demo
mkdir poetry_cython_demo/compiled
touch poetry_cython_demo/cython_code.pyx poetry_cython_demo/compiled/source.c poetry_cython_demo/compiled/source.h

and replace the pyproject.toml with the gist version.
Then run:

poetry build -vvv

The expected result is that the sdist package includes the C sources and the .pyx file and the wheel only includes the __init__.py.
The actual result is that the wheel includes the .pyx file.

❯ poetry build -vvv
…
Building poetry-cython-demo (0.1.0)
  - Building sdist
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/__init__.py
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/cython_code.pyx
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/compiled/source.c
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/compiled/source.h
  - Adding: pyproject.toml
  - Built poetry-cython-demo-0.1.0.tar.gz
  - Building wheel
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/__init__.py
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/cython_code.pyx
…

As a side note, my first expectation was that include is working recursively as exclude, so I thought
{ path = "poetry_cython_demo/compiled", format = "sdist" }
would be enough, but than the result is even stranger output where sdist and wheel seam to be switched:

❯ poetry build -vvv
…
Building poetry-cython-demo (0.1.0)
  - Building sdist
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/__init__.py
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/cython_code.pyx
  - Adding: pyproject.toml
  - Built poetry-cython-demo-0.1.0.tar.gz
  - Building wheel
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/__init__.py
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/compiled/source.c
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/compiled/source.h
  - Adding: /home/agoertz/projects/poetry-cython-demo/poetry_cython_demo/cython_code.pyx
…
@nylocx nylocx added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 5, 2021
@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 Nov 5, 2021
@finswimmer finswimmer self-assigned this Nov 5, 2021
@finswimmer
Copy link
Member

Hello @nylocx,

thanks for reporting. I can confirm this bug and a fix is on the way: python-poetry/poetry-core#228

fin swimmer

@nylocx
Copy link
Author

nylocx commented Nov 5, 2021

Wao, that was a quick one, thanks!

@nylocx
Copy link
Author

nylocx commented Dec 23, 2021

I just checked in it does not work as I expected here is the result of the wheel. It still contains the pyx file. Any idea what is going wrong there? As the test looks like it should check for this.
poetry_cython_demo-0.1.0-py3-none-any.whl.tar.gz

--- edit
@finswimmer
Ok, it seems the patch is not included in poetry_core 1.07 even though it was released after the merge to master.
In which Version will this fix be included?

@nylocx
Copy link
Author

nylocx commented Apr 12, 2022

@finswimmer I really don't want to annoy you but can you give an approximate ETA when this will land in poetry? I think it was not included in core 1.0.8

Copy link

github-actions bot commented Mar 2, 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 2, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants