5 Creating a Source Distribution

As shown in section 2.1, you use the sdist command to create a source distribution. In the simplest case,

python setup.py sdist
(assuming you haven't specified any sdist options in the setup script or config file), sdist creates the archive of the default format for the current platform. The default formats are:
Platform  Default archive format for source distributions 
Unix gzipped tar file (.tar.gz)
Windows zip file
You can specify as many formats as you like using the --formats option, for example:
python setup.py sdist --formats=gztar,zip
to create a gzipped tarball and a zip file. The available formats are:
Format  Description  Notes 
zip zip file (.zip) (1),(2)
gztar gzip'ed tar file (.tar.gz) (3),(4)
bztar bzip2'ed tar file (.tar.gz) (4)
ztar compressed tar file (.tar.Z) (4)
tar tar file (.tar)  

Notes:

(1)
default on Windows
(2)
under both Unix and Windows, requires either external Info-ZIP utility or the zipfile module
(3)
default on Unix
(4)
requires external utilities: tar and possibly one of gzip, bzip2, or compress


Subsections

See About this document... for information on suggesting changes.