ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
ActivePython 2.4
Python Documentation
Distributing Python Modules
1. An Introduction to Distutils
2. Writing the Setup Script
3. Writing the Setup Configuration File
4. Creating a Source Distribution
4.1 Specifying the files to distribute
4.2 Manifest-related options
5. Creating Built Distributions
6. Registering with the Package Index
7. Examples
8. Extending Distutils
9. Command Reference
10. API Reference
Module Index
Index
About this document ...

MyASPN >> Reference >> ActivePython 2.4 >> Python Documentation >> Distributing Python Modules
ActivePython 2.4 documentation


4. Creating a Source Distribution

As shown in section 1.2, 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 format is a gzip'ed tar file (.tar.gz) on Unix, and ZIP file on Windows.

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),(3)
gztar gzip'ed tar file (.tar.gz) (2),(4)
bztar bzip2'ed tar file (.tar.bz2) (4)
ztar compressed tar file (.tar.Z) (4)
tar tar file (.tar) (4)

Notes:

(1)
default on Windows
(2)
default on Unix
(3)
requires either external zip utility or zipfile module (part of the standard Python library since Python 1.6)
(4)
requires external utilities: tar and possibly one of gzip, bzip2, or compress



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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved