Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2380

Location of data files

Date 2011-04-01 20:37 +0200
From Matthias-Christian Ott <ott@mirix.org>
Subject Location of data files
Newsgroups comp.lang.python
Message-ID <mailman.90.1301684005.2990.python-list@python.org> (permalink)

Show all headers | View raw


Hi,

I want to include data files with a python package. With distutils it
seems common to specifiy these files in the data_files argument with a
non-portable location (e.g. data_files=[('share/example', 'icon.png')]).
Another approach is to include the file in the Python module of the
package (e.g. example/data) and specify the submodule in package_data
argument and load them via pkgutil or pkg_ressources. This method seems
portable, but doesn't allow customisation and doesn't conform to the
FHS.

What is the recommended way to allow easy platform-specific packaging
(e.g. data files are installed to /usr/share when requested), portability and
customisation (i.e. data files can be replaced by the user or
alternative locations can be specified)?

Regards,
Matthias-Christian

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Location of data files Matthias-Christian Ott <ott@mirix.org> - 2011-04-01 20:37 +0200

csiph-web