I'm trying to build a package for my project, using setup.py
and setuptools. A general search has suggested that data files should be placed under my python package.
For instance, project/src/package/data
.
But my situation is more in line with this question.
My project consists on a Python console application and a HTML interactive application. Right now (before setup.py
), I have the console application copy the HTML files to a specific directory with a special command. I'm following this directory structure in source control.
project
|-+ console
| |-+ package
| |-- __init__.py, etc.
|-+ viz
|-+ css
|-+ js
|-- index.html
I'm not sure how this behaviour can be replicated with setup.py
and egg files.
How can I make sure that
viz
will be packaged? Thepackage_data
option seems to be relative to a package (implying thatviz
should be placed under a package).So,
package_data = {'': ['viz/*']}
is not what I am looking for.How is the extraction done?
Should I usepkg_resources.resource_filename
to getviz
into the cache, and thenshutil
to copy the files to the intended location? Is there a more practical alternative?