Open tovrstra opened 7 years ago
I've gained some more experience with this. The setuptools option works very well. These are the required steps:
data
subdirectory.MANIFEST.in
distutils
to setuptools
in setup.py
Cython.Distutils
by Cython.Build
in setup.py
include_package_data=True
when calling the setup
function. Remove all other references to data files in setup.py
.my_install_data
from setup.py
horton.context
pkg_resources
module, instead of horton.context
. The module pkg_resources
comes with setuptools
. There are two ways of using it:
P.S. Depending on setuptools is not a big deal. It is omnipresent these days, e.g installed when you have pip.
A potential drawback is that nosetests does not find the tests when the package is installed as an Egg. The egg can be disabled in setup.py
by adding an argument zip_safe=False
to the setup()
call.
Our
context.py
is currently our approach to locate installed data files (test data files, basis sets, ...), which we install nicely in the FHS-designated$PREFIX/share
directory. (See http://www.pathname.com/fhs/) This has a few problems though:context.py
(if the package has data files)..egg
installations.There are a few alternatives:
context.py
: use__file__
to locate data files.