questions re: data files with Distribute's test

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

questions re: data files with Distribute's test

Chris Jerdonek-3
I have a few questions about including data files when running

    python test

with Distribute while using Python 3 and the "use_2to3" keyword argument.

Some of my test files are in a subdirectory of my project outside of
the package directory.  I'm able to have the test files copied over to
the build directory when running "test" by including a package_data
argument something like the following:

package_data = {'package': ['../path/to/test/data/*.json']}

My questions are--

(1) Is it acceptable to be using parent directories to reference files
outside the package directory, or is there a better way to reference
paths relative to the project root?  Perhaps data_files?

(2) Is there an easy way to make it so that these data files get
copied only when the test command is being run?  The files aren't
needed when not developing.

(3) Are there any best practices around including/installing test
files in distributions (or should they be left out)?

Distutils-SIG maillist  -  [hidden email]