1. PyPA
  2. Python Packaging Authority Projects
  3. wheel
  4. Issues
Issue #147 new

bdist_wheel should start by cleaning up its build directory

Xavier Fernandez
created an issue

bdist_wheel does not clean up its build directory making it easy to include obsolete/unwanted files.

On python 2.7, if you run python setup.py bdist_wheel once, add a file in build/lib.linux-x86_64-2.7 and rerun python setup.py bdist_wheel you'll have the file in your wheel. I had this issue with https://github.com/Polyconseil/getconf but it concerns all packages, you can easily reproduce with the wheel package.

It can be quite unsettling, since it bypasses, all MANIFEST or find_packages rules...

It would seem cleaner and safer to simply start from a fresh directory and delete it afterwards.

Comments (6)

  1. feluxe

    bdist_wheel does not clean up its build directory making it easy to include obsolete/unwanted files.

    I have the same issue. It's very annoying, because you usually notice the obsolete modules/packages after publishing. So you have to bump version num again, re-build, re-publish, etc...

  2. Ed Morley

    In addition to including stale files from a previous release, this bug also affects people who need to generate separate Python 2 and Python 3 wheels (eg the package contents for Python 3 includes async versions of the library in it's packages setup.py list).

    For example one might presume this would work:

    $ pip3 install -U twine setuptools wheel
    $ pip2 install -U setuptools wheel
    $ rm -rf dist/ build/
    $ python3 setup.py sdist bdist_wheel
    $ python2 setup.py bdist_wheel
    $ twine upload dist/*
    

    However the Python 2 version of the wheel will also include whatever files were generated for the Python 3 wheel, unless an extra rm -rf build/ is thrown in prior to the python2 setup.py bdist_wheel.

  3. Log in to comment