googleapis / proto-plus-python

Beautiful, idiomatic protocol buffers in Python
Apache License 2.0
169 stars 35 forks source link

running setup.py bdist_wheel results in build/, docs/ and testing/ in the wheel #503

Open smoser opened 6 hours ago

smoser commented 6 hours ago

Thanks for stopping by to let us know something could be better!

Environment details

Steps to reproduce

  1. Run setup.py bdist_wheel with pip-installed versions of setuptools, wheel
  2. look at created wheel, it will have testing/, docs/ and build/ directories in it.

Attached do-build.sh.txt will recreate.

Example trimmed outputt:

% sh  /tmp/do-build.sh.txt
$ mkdir -p /tmp/tmp.0J6yfGbozE/venv
$ python3 -m venv /tmp/tmp.0J6yfGbozE/venv
$ which pip
/tmp/tmp.0J6yfGbozE/venv/bin/pip

installing build deps into /tmp/tmp.0J6yfGbozE/venv
pip=/tmp/tmp.0J6yfGbozE/venv/bin/pip python3=/tmp/tmp.0J6yfGbozE/venv/bin/python3
$ pip install setuptools build wheel
Collecting setuptools
  Using cached setuptools-75.3.0-py3-none-any.whl.metadata (6.9 kB)
Collecting build
  Using cached build-1.2.2.post1-py3-none-any.whl.metadata (6.5 kB)
...
Successfully installed build-1.2.2.post1 packaging-24.1 pyproject_hooks-1.2.0 setuptools-75.3.0 wheel-0.44.0

$ rm -Rf dist/

building with /tmp/tmp.0J6yfGbozE/venv/bin/python3
$ /tmp/tmp.0J6yfGbozE/venv/bin/python3 setup.py bdist_wheel
...
adding 'testing/constraints-3.9.txt'
adding 'proto_plus-1.25.0.dist-info/LICENSE'
adding 'proto_plus-1.25.0.dist-info/METADATA'
adding 'proto_plus-1.25.0.dist-info/WHEEL'
adding 'proto_plus-1.25.0.dist-info/top_level.txt'
adding 'proto_plus-1.25.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel

built dist/proto_plus-1.25.0-py3-none-any.whl
-rw-rw-r-- 1 smoser smoser 230125 Nov  1 17:08 dist/proto_plus-1.25.0-py3-none-any.whl

...

FAIL: your wheel has docs/ testing/ build/

The second run will contain build/, docs/ and testing/ (from a dirty directory). The first will only contain docs and testing.

Here is a full list of the created wheel. unzip-wheel.txt

smoser commented 6 hours ago

I unsuccessfully tried https://github.com/googleapis/proto-plus-python/pull/502 .