Name
data_files
Synopsis
data_files=[list of pairs(target_directory,[list of files]) ]
The value of keyword argument data_files is a list
of pairs. Each pair’s first item is a string and
names a target directory (i.e., a directory
where distutils places data files when installing
the distribution); the second item is the list of file path strings
for files to put in the target directory. At installation time,
distutils places each target directory as a
subdirectory of Python’s
sys.prefix for a pure distribution, or of
Python’s sys.exec_prefix for a
non-pure distribution. distutils places the given
files directly in the respective target directory, never in
subdirectories of the target. For example, given the following
data_files usage:
data_files = [ ('miscdata', ['conf/config.txt',
'misc/sample.txt']) ]
distutils includes in the distribution the file
config.txt from sub-directory
conf of the distribution root, and the file
sample.txt from subdirectory
misc of the distribution root. At installation
time, distutils creates a subdirectory named
miscdata in Python’s
sys.prefix directory (or in the
sys.exec_prefix directory, if the distribution is
non-pure), and copies the two files into
miscdata/config.txt and
miscdata/sample.txt.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access