How to test python module

Hi guys,

This is a revision on Brad's PR that now calls pip to install the test package.  I'm hung up on an issue here: the data_files keyword.  From the Python docs (https://docs.python.org/2/distutils/setupscript.html), data_files looks like it is potentially dangerously platform specific.  I have Ondrej and Anthony's use cases in mind, where they may want to install things to /usr/lib or whatever.  I don't see a great way of making that kind of thing cross-platform.

I'm thinking that maybe the output of the CMake-generated manifest belong in package_data, rather than data_files?  This means libraries generated by the CMake build would not be system-wide, but rather contained within the package.  This thus does not really meet Ondrej and Anthony's use case.

If we don't do this, then the alternative might be to not alter the CMAKE_INSTALL_PREFIX, so that CMake figures out the best cross-platform place to put things.  It would work on the system building the package, but it is essentially just leaving the installation part totally to CMake and then would not involve distutils in copying CMake's output.

Any opinions or enlightenment for me here?

PS: the manifest parser (CMaker._parse_manifest) currently does things wrong.  The python docs above show that the directory is where you want the files to go, not where they are (this was my original interpretation).  I have left it broken until we decide what the best way to do this is, because that decision determines the output folders we would use.
Yes, passing the values explicitly during setup is the best way to fix this.

A version of FindPythonLibs.cmake will come out in the next released version of CMake (3.1).  It can be copied locally in projects that need it in the interim. 

FindPythonLibsNew.cmake calls the python executable directly, which would work for some cases, but which does not work when cross compiling or on Linux distributions like Fedora that installs the libs for Python3 in their build process without the executable.

The long-term fix for that problem is to use

  https://github.com/davidsansome/python-cmake-buildsystem

which creates a PythonConfig.cmake, so that scientific projects can build and link against CPython in a reliable way with find_package(Python)...