Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(21193)

Side by Side Diff: Doc/distutils/sourcedist.rst

Issue 6516: reset owner/group to root for distutils tarballs
Patch Set: Created 5 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Lib/distutils/archive_util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 .. _source-dist: 1 .. _source-dist:
2 2
3 ****************************** 3 ******************************
4 Creating a Source Distribution 4 Creating a Source Distribution
5 ****************************** 5 ******************************
6 6
7 As shown in section :ref:`distutils-simple-example`, you use the :command:`sdist ` command 7 As shown in section :ref:`distutils-simple-example`, you use the :command:`sdist ` command
8 to create a source distribution. In the simplest case, :: 8 to create a source distribution. In the simplest case, ::
9 9
10 python setup.py sdist 10 python setup.py sdist
11 11
12 (assuming you haven't specified any :command:`sdist` options in the setup script 12 (assuming you haven't specified any :command:`sdist` options in the setup script
13 or config file), :command:`sdist` creates the archive of the default format for 13 or config file), :command:`sdist` creates the archive of the default format for
14 the current platform. The default format is a gzip'ed tar file 14 the current platform. The default format is a gzip'ed tar file
15 (:file:`.tar.gz`) on Unix, and ZIP file on Windows. 15 (:file:`.tar.gz`) on Unix, and ZIP file on Windows.
16 16
17 You can specify as many formats as you like using the :option:`--formats` 17 You can specify as many formats as you like using the :option:`--formats`
18 option, for example:: 18 option, for example::
19 19
20 python setup.py sdist --formats=gztar,zip 20 python setup.py sdist --formats=gztar,zip
21 21
22 to create a gzipped tarball and a zip file. The available formats are: 22 to create a gzipped tarball and a zip file. The available formats are:
23 23
24 +-----------+-------------------------+---------+ 24 +-----------+-------------------------+---------+
25 | Format | Description | Notes | 25 | Format | Description | Notes |
26 +===========+=========================+=========+ 26 +===========+=========================+=========+
27 | ``zip`` | zip file (:file:`.zip`) | (1),(3) | 27 | ``zip`` | zip file (:file:`.zip`) | (1),(3) |
28 +-----------+-------------------------+---------+ 28 +-----------+-------------------------+---------+
29 | ``gztar`` | gzip'ed tar file | (2),(4) | 29 | ``gztar`` | gzip'ed tar file | \(2) |
30 | | (:file:`.tar.gz`) | | 30 | | (:file:`.tar.gz`) | |
31 +-----------+-------------------------+---------+ 31 +-----------+-------------------------+---------+
32 | ``bztar`` | bzip2'ed tar file | \(4) | 32 | ``bztar`` | bzip2'ed tar file | |
33 | | (:file:`.tar.bz2`) | | 33 | | (:file:`.tar.bz2`) | |
34 +-----------+-------------------------+---------+ 34 +-----------+-------------------------+---------+
35 | ``ztar`` | compressed tar file | \(4) | 35 | ``ztar`` | compressed tar file | \(4) |
36 | | (:file:`.tar.Z`) | | 36 | | (:file:`.tar.Z`) | |
37 +-----------+-------------------------+---------+ 37 +-----------+-------------------------+---------+
38 | ``tar`` | tar file (:file:`.tar`) | \(4) | 38 | ``tar`` | tar file (:file:`.tar`) | |
39 +-----------+-------------------------+---------+ 39 +-----------+-------------------------+---------+
40 40
41 Notes: 41 Notes:
42 42
43 (1) 43 (1)
44 default on Windows 44 default on Windows
45 45
46 (2) 46 (2)
47 default on Unix 47 default on Unix
48 48
49 (3) 49 (3)
50 requires either external :program:`zip` utility or :mod:`zipfile` module (par t 50 requires either external :program:`zip` utility or :mod:`zipfile` module (par t
51 of the standard Python library since Python 1.6) 51 of the standard Python library since Python 1.6)
52 52
53 (4) 53 (4)
54 requires external utilities: :program:`tar` and possibly one of :program:`gzi p`, 54 requires the :program:`compress` program. Notice that this format is now
55 :program:`bzip2`, or :program:`compress` 55 pending for deprecation and will be removed in the future versions of Python.
56
57 When using any ``tar`` format (``gztar``, ``bztar``, ``ztar`` or
58 ``tar``), under Unix you can specify the ``owner`` and ``group`` names
59 that will be set for each member of the archive.
60
61 For example, if you want all files of the archive to be owned by root::
62
63 python setup.py sdist --owner=root --group=root
56 64
57 65
58 .. _manifest: 66 .. _manifest:
59 67
60 Specifying the files to distribute 68 Specifying the files to distribute
61 ================================== 69 ==================================
62 70
63 If you don't supply an explicit list of files (or instructions on how to 71 If you don't supply an explicit list of files (or instructions on how to
64 generate one), the :command:`sdist` command puts a minimal default set into the 72 generate one), the :command:`sdist` command puts a minimal default set into the
65 source distribution: 73 source distribution:
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 There are a couple of options that modify this behaviour. First, use the 219 There are a couple of options that modify this behaviour. First, use the
212 :option:`--no-defaults` and :option:`--no-prune` to disable the standard 220 :option:`--no-defaults` and :option:`--no-prune` to disable the standard
213 "include" and "exclude" sets. 221 "include" and "exclude" sets.
214 222
215 Second, you might just want to (re)generate the manifest, but not create a sourc e 223 Second, you might just want to (re)generate the manifest, but not create a sourc e
216 distribution:: 224 distribution::
217 225
218 python setup.py sdist --manifest-only 226 python setup.py sdist --manifest-only
219 227
220 :option:`-o` is a shortcut for :option:`--manifest-only`. 228 :option:`-o` is a shortcut for :option:`--manifest-only`.
OLDNEW
« no previous file with comments | « no previous file | Lib/distutils/archive_util.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+