bpo-25592: Improve documentation of distutils data_files (GH-9767) (G… · python/cpython@40a101d (original) (raw)
`@@ -520,20 +520,23 @@ following way::
`
520
520
` setup(...,
`
521
521
` data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
`
522
522
` ('config', ['cfg/data.cfg']),
`
523
``
`-
('/etc/init.d', ['init-script'])]
`
524
523
` )
`
525
524
``
526
``
`-
Note that you can specify the directory names where the data files will be
`
527
``
`-
installed, but you cannot rename the data files themselves.
`
528
``
-
529
525
`Each (directory, files) pair in the sequence specifies the installation
`
530
``
`-
directory and the files to install there. If directory is a relative path, it
`
531
``
is interpreted relative to the installation prefix (Python's ``sys.prefix`` for
532
``
pure-Python packages, ``sys.exec_prefix`` for packages that contain extension
533
``
`-
modules). Each file name in files is interpreted relative to the
`
534
``
`` -
:file:setup.py
script at the top of the package source distribution. No
``
535
``
`-
directory information from files is used to determine the final location of
`
536
``
`-
the installed file; only the name of the file is used.
`
``
526
`+
directory and the files to install there.
`
``
527
+
``
528
`` +
Each file name in files is interpreted relative to the :file:setup.py
``
``
529
`+
script at the top of the package source distribution. Note that you can
`
``
530
`+
specify the directory where the data files will be installed, but you cannot
`
``
531
`+
rename the data files themselves.
`
``
532
+
``
533
`+
The directory should be a relative path. It is interpreted relative to the
`
``
534
installation prefix (Python's ``sys.prefix`` for system installations;
``
535
``site.USER_BASE`` for user installations). Distutils allows *directory* to be
``
536
`+
an absolute installation path, but this is discouraged since it is
`
``
537
`+
incompatible with the wheel packaging format. No directory information from
`
``
538
`+
files is used to determine the final location of the installed file; only
`
``
539
`+
the name of the file is used.
`
537
540
``
538
541
``` You can specify the data_files
options as a simple sequence of files
```
539
542
`without specifying a target directory, but this is not recommended, and the
`