[docs] [issue36237] data_files / Install Additional Files written unclearly such that it's not obvious what parameter is what

jt report at bugs.python.org
Fri Mar 8 07:38:31 EST 2019


New submission from jt <jonas at thiem.email>:

I find the following doc section found at https://docs.python.org/3.7/distutils/setupscript.html#installing-additional-files about data_files somewhat unclear:

```
setup(...,
      data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
                  ('config', ['cfg/data.cfg']),
                  ('/etc/init.d', ['init-script'])]
     )

Each (directory, files) pair in the sequence specifies the installation directory and the files to install there.

...

The directory should be a relative path. It is interpreted relative to the installation prefix (Python’s sys.prefix for system installations; site.USER_BASE for user installations).
```

This gives me no clue what the installation actually is relative to, since e.g. sys.prefix is just `/usr` - surely I'm not supposed to specify "lib64/python3.7/site-packages/<mypackage-name>/file" as a target?

That is probably not how that text is supposed to be read and I'm sure packaging expert understand what sort of prefix is actually meant, but could this be more elaborated on, maybe an actual example for a fake package of whether this is e.g. the package folder root after the install inside the site packages, or the site packages folder itself, or ...?

----------
assignee: docs at python
components: Documentation
messages: 337471
nosy: docs at python, jt
priority: normal
severity: normal
status: open
title: data_files / Install Additional Files written unclearly such that it's not obvious what parameter is what
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36237>
_______________________________________


More information about the docs mailing list