I know it is possible to force sdist
to produce .zip from command line:
python setup.py sdist --formats=zip
But how to make this option a default for my setup.py
?
I'd like to get consistency for running setup.py sdist
on both Windows and Linux, and I choose .zip format, because I can turn .zip into executable.
Found it myself from distutils docs here and here, and from distutils sources:
# Override sdist to always produce .zip archive
from distutils.command.sdist import sdist as _sdist
class sdistzip(_sdist):
def initialize_options(self):
_sdist.initialize_options(self)
self.formats = 'zip'
setup(
...
cmdclass={'sdist': sdistzip},
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With