[Distutils] wheel including files it shouldn't

Paul Moore p.f.moore at gmail.com
Wed Apr 27 17:45:00 EDT 2016


On 27 April 2016 at 18:39, Ethan Furman <ethan at stoneleaf.us> wrote:
> My current process is:
>
>   python3.5 setup.py sdist --format=gztar,zip bdist_wheel upload
>
> What should I be doing instead?

My suggestion would be

# Build the sdist
python3.5 setup.py sdist --format=gztar,zip
# Build the wheel *from that sdist*
python3.5 -m pip wheel dist/*.zip # the path to the sdist built just above
# Upload the files once you've checked them
twine upload *.whl dist/* # because setup.py upload can't upload prebuilt files

But I agree that's somewhat clumsy compared to the command you used.
It has the benefit of working correctly though :-)

I agree that it's a bug that the bdist_wheel command doesn't respect
your MANIFEST.in. It's also a (design-level) bug that bdist_wheel
*needs* to implement MANIFEST.in support for itself.
IMO, it's a further bug that setup.py upload doesn't allow you to
build the files first, test them, and *then* upload them.

Personally, I agree with Donald that the "normal" process of building
a distribution should be:

1. Build the sdist.
2. Build wheels *from* that sdist.
3. Check the built sdist and wheels.
4. Upload the files once you've confirmed they are OK.

The tools should make that as transparent as possible (I'm not averse
to a command that builds sdist and wheels together, but such a command
could easily use the sdist to build the wheels "behind the scenes")
and there may be special cases (incremental builds of wheels when a
full recompile is a significant cost) but those are quality of
implementation details.

Paul


More information about the Distutils-SIG mailing list