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

Update wheel.py #260

Closed
wants to merge 1 commit into from
Closed

Update wheel.py #260

wants to merge 1 commit into from

Conversation

nylocx
Copy link

@nylocx nylocx commented Dec 23, 2021

Fix an error that caused excluded files to be added to the wheel

Resolves: python-poetry#

  • Added tests for changed code.
  • Updated documentation for changed code.

Fix an error that caused excluded files to be added to the wheel
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell D 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@finswimmer finswimmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please provide a test that covers this change?

@nylocx
Copy link
Author

nylocx commented Dec 23, 2021

I currently don't have the time to write a complete test case that could be integrated here, but I have produced a minimal example to showcase this issue:
https://github.com/nylocx/poetry-cython-demo

Building this results in:

poetry build -vvv -f wheel
Using virtualenv: /root/.cache/pypoetry/virtualenvs/poetry-cython-demo-Wrv1XBJQ-py3.9
Building poetry-cython-demo (0.1.0)
  - Building wheel
  - Adding: /root/poetry-cython-demo/poetry_cython_demo/__init__.py
  - Adding: /root/poetry-cython-demo/poetry_cython_demo/cython_code.c
A setup.py file already exists. Using it.
running build
running build_py
running build_ext
  - Adding: cython_code.cpython-39-x86_64-linux-gnu.so
  - Adding: poetry_cython_demo/cython_code.pyx
Skipping: /root/poetry-cython-demo/COPYING
Skipping: /root/poetry-cython-demo/LICENSE
  - Built poetry_cython_demo-0.1.0-cp39-cp39-manylinux_2_31_x86_64.whl

Note the adding after the running build_ext this is coming from the section I changed with the line in the pull request.

In this example I had to remove the other bug that is fixed in with #228 because I could not get a poetry version that includes the fix even an:
curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@master
and a manual pip --update install git+https://github.com/python-poetry/poetry-core.git in poetries venv did not solve it.

@abn
Copy link
Member

abn commented Jan 28, 2025

Closing as this cannot be reproduced anymore. It is likely that this was fixed elsewhere. Thank you for your contribution.

podman run --rm -i --entrypoint bash docker.io/python:3.10 <<EOF
set -xe
python -m pip install --disable-pip-version-check --root-user-action ignore -q poetry
git clone https://github.com/nylocx/poetry-cython-demo.git
cd poetry-cython-demo
poetry build -f wheel
unzip -v dist/*.whl
EOF
+ unzip -v dist/poetry_cython_demo-0.1.0-cp310-cp310-manylinux_2_36_x86_64.whl
Archive:  dist/poetry_cython_demo-0.1.0-cp310-cp310-manylinux_2_36_x86_64.whl
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
      22  Defl:N       24  -9% 2016-01-01 00:00 e9710a82  poetry_cython_demo/__init__.py
  105885  Defl:N    18588  82% 2016-01-01 00:00 9d5d98b1  poetry_cython_demo/cython_code.c
     250  Defl:N      134  46% 2016-01-01 00:00 033e4fd9  poetry_cython_demo-0.1.0.dist-info/METADATA
     110  Defl:N      106   4% 2016-01-01 00:00 6da57f03  poetry_cython_demo-0.1.0.dist-info/WHEEL
     415  Defl:N      263  37% 2016-01-01 00:00 87dc3624  poetry_cython_demo-0.1.0.dist-info/RECORD
--------          -------  ---                            -------
  106682            19115  82%                            5 files

@abn abn closed this Jan 28, 2025
@abn
Copy link
Member

abn commented Jan 28, 2025

Was resolved by #228.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants