theochem / horton

HORTON: Helpful Open-source Research TOol for N-fermion systems
http://theochem.github.io/horton/
GNU General Public License v3.0
92 stars 40 forks source link

Remove context.py #257

Open tovrstra opened 7 years ago

tovrstra commented 7 years ago

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:

  1. The solution is non-modular. When we start to split of packages, every single one will have a context.py (if the package has data files).
  2. It duplicates some functionality already present in Python (and setuptools) to access installed data files.
  3. It does not work on .egg installations.

There are a few alternatives:

tovrstra commented 6 years ago

I've gained some more experience with this. The setuptools option works very well. These are the required steps:

tovrstra commented 6 years ago

P.S. Depending on setuptools is not a big deal. It is omnipresent these days, e.g installed when you have pip.

tovrstra commented 6 years ago

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.