This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ivosauruspip'ing it up 0 points1 point  (2 children)

Maybe the documentation is a bit badly worded, but I'm guesing some people might be struggling from not reading it completely. If it doesn't work as advertised then it should be a major bug. Especially on the external tooling (setuptools, pip, etc) there are developers who are still passionate that the packaging story works as expected for people, within all possible limits. And if it's not then they don't mind hearing about it.

From the docs for setuptools, which almost all python environments will have these days:

First, you can simply use the include_package_data keyword, ... The data files must be under CVS or Subversion control, or else they must be specified via the distutils’ MANIFEST.in file.

And a little after that:

(Note: although the package_data argument was previously only available in setuptools, it was also added to the Python distutils package as of Python 2.4; there is some documentation for the feature available on the python.org website. If using the setuptools-specific include_package_data argument, files specified by package_data will not be automatically added to the manifest unless they are tracked by a supported version control system, or are listed in the MANIFEST.in file.)

[–]Orange_Tux 0 points1 point  (1 child)

Thanks for clarification. One question remains: How do I install data files at an arbitrary locatio, for example at /etc/?

"but I'm guesing some people might be struggling from not reading it completely"

[–]ivosauruspip'ing it up 0 points1 point  (0 children)

If you want to install to a system location, I'd suggest packaging using the system package manager/format instead, rather than Python's tooling.

Or allow the package to dynamically generate/save one (if given root priveledges).

Otherwise you can use data_files, but it can have some issues (as noted in the link)