rest25/distutils/sourcedist.rst => rest262/distutils/sourcedist.rst
f1.. _source-dist:
2
3******************************
4Creating a Source Distribution
5******************************
6
n7-As shown in section :ref:`simple-example`, you use the :command:`sdist` command
n7+As shown in section :ref:`distutils-simple-example`, you use the :command:`sdist` command
8to create a source distribution.  In the simplest case, ::
9
10   python setup.py sdist
11
12(assuming you haven't specified any :command:`sdist` options in the setup script
13or config file), :command:`sdist` creates the archive of the default format for
14the current platform.  The default format is a gzip'ed tar file
15(:file:`.tar.gz`) on Unix, and ZIP file on Windows.
117The order of commands in the manifest template matters: initially, we have the
118list of default files as described above, and each command in the template adds
119to or removes from that list of files.  Once we have fully processed the
120manifest template, we remove files that should not be included in the source
121distribution:
122
123* all files in the Distutils "build" tree (default :file:`build/`)
124
n125-* all files in directories named :file:`RCS`, :file:`CVS` or :file:`.svn`
n125+* all files in directories named :file:`RCS`, :file:`CVS`, :file:`.svn`,
126+  :file:`.hg`, :file:`.git`, :file:`.bzr` or :file:`_darcs`
126
127Now we have our complete list of files, which is written to the manifest for
128future reference, and then used to build the source distribution archive(s).
129
130You can disable the default set of included files with the
131:option:`--no-defaults` option, and you can disable the standard exclude set
132with :option:`--no-prune`.
133
151#. include anything matching :file:`\*.txt` or :file:`\*.py` in the sub-tree
152   under :file:`examples`,
153
154#. exclude all files in the sub-trees starting at directories matching
155   :file:`examples/sample?/build`\ ---this may exclude files included by the
156   previous two steps, so it's important that the ``prune`` command in the manifest
157   template comes after the ``recursive-include`` command
158
t159-#. exclude the entire :file:`build` tree, and any :file:`RCS`, :file:`CVS` and
t160+#. exclude the entire :file:`build` tree, and any :file:`RCS`, :file:`CVS`,
160-   :file:`.svn` directories
161+   :file:`.svn`, :file:`.hg`, :file:`.git`, :file:`.bzr` and :file:`_darcs`
162+   directories
161
162Just like in the setup script, file and directory names in the manifest template
163should always be slash-separated; the Distutils will take care of converting
164them to the standard representation on your platform. That way, the manifest
165template is portable across operating systems.
166
167
168.. _manifest-options:
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op