FAQ
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

Search Discussions

  • Matthias-Christian Ott at Apr 1, 2011 at 8:47 pm

    On Fri, Apr 01, 2011 at 08:37:35PM +0200, Matthias-Christian Ott wrote:
    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)?
    It seems distutils2 will support this:

    http://distutils2.notmyidea.org/setupcfg.html#resources

    Regards,
    Matthias-Christian

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedApr 1, '11 at 6:37p
activeApr 1, '11 at 8:47p
posts2
users1
websitepython.org

1 user in discussion

Matthias-Christian Ott: 2 posts

People

Translate

site design / logo © 2022 Grokbase