Make the case where prefix is specified but python_prefix is not consistent
with how the full Python module is handled.
Fix a case where the minimal Python module could be installed to a directory
named literally 'python_prefix'.
This change mirrors the one for the Cython interface. Pip is used as
the build frontend, setuptools is used as the backend. A wheel file is
built during the 'scons build' phase to ensure that all the machinery is
working properly; this wheel is not used further.
This change provides similar benefits as for the other two Python
distributions. It should allow easier uploading to PyPI and now includes
the README and License files.
Fixes setup_cantera and the post-install message to reference the path
of the Python module on the target system rather than the staging
directory.
Also, generated .pyc files no long specify the path in the staging
directory. This has no effect on the use of the .pyc files, but helps
avoid warnings/errors from packaging system linters (notably, on
FreeBSD).
Fixes#1094
In #1012, normapth was no longer exported from buildutils, but I missed
adding that import in the builder for python_minimal. In addition, Dict
is only available while type checking in buildutils, so it should be
quoted as a forward reference.
The python_minimal SConscript did't copy
cantera yaml tools to python_minimal directory
and therefore didn's install these scripts.
Signed-off-by: band-a-prend <torokhov-s-a@yandex.ru>
Update and make more consistent the specification of Python package
building. Since SCons can be run by Python 3 now, we cannot assume that
the Python running SCons is Python 2. This changes a bunch of
assumptions in SConstruct about where things should be built or
installed. This commit addresses those assumptions by making the options
for Python 2 and Python 3 symmetric.
Replace distutils with setuptools in the Cython and python_minimal
interfaces. Add console_scripts option to generate OS specific scripts to run
ck2cti, mixmaster, and ctml_writer
Remove script files that are obsoleted by console_scripts from
setuptools. Remove installation of the script modules from SConstruct.
Fix Python installers so that when a prefix directory is specified on the
command line, setuptools doesn't throw an error. The setuptools documentation at
[1] prefers setting PYTHONUSERBASE rather than PYTHONPATH. Use normpath to avoid
bugs in setuptools on Windows [2]. Specify an empty "--prefix" if the compiler
is clang to fix a bug with Homebrew Python on Mac OSX [3].
[1]: https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
[2]: http://stackoverflow.com/q/31629398
[3]: https://github.com/Homebrew/homebrew-python/issues/187