diff options
-rw-r--r-- | python/README.rst | 24 | ||||
-rw-r--r-- | setup.py (renamed from python/setup.py) | 19 |
2 files changed, 27 insertions, 16 deletions
diff --git a/python/README.rst b/python/README.rst index 9436ae1..7d9a1e6 100644 --- a/python/README.rst +++ b/python/README.rst @@ -45,26 +45,31 @@ Installation Suppose you have checked out the PHAT repository at location $PHAT. Then you can:: - cd $PHAT/python + cd $PHAT - ln -s ../include include # (or copy, we just need $PHAT/include to be in the current folder as well) + pip install . - pip install pybind11 - - python setup.py install - -This will install PHAT for whatever Python installation your ``python`` executable is associated with. +This will install PHAT for whatever Python installation your ``pip`` executable is associated with. Please ensure you use the ``pip`` that comes from the same directory where your ``python`` executable lives! Currently, the PHAT Python bindings are known to work on: * Linux with Python 2.7 (tested on Ubuntu 14.04 with system Python) * Linux with Python 3.5 (tested on Ubuntu 14.04 with Anaconda) -* Mac OS X with Python 2.7 (tested on El Capitan with Anaconda) -* Mac OS X with Python 3.5 (tested on El Capitan with Anaconda) +* Mac OS X with Python 2.7.12 (tested on Sierra with homebrew) +* Mac OS X with Python 3.5 (tested on Sierra with homebrew) Other configurations are untested. +Please note that this package DOES NOT work with the Python 2.7.10 that ships with the operating +system in Mac OS X. These words of wisdom from `python.org`_ are worth heeding: + + The version of Python that ships with OS X is great for learning but it’s not good for development. + The version shipped with OS X may be out of date from the official current Python release, + which is considered the stable production version. + +We recommend installing Python on Mac OS X using either homebrew or Anaconda, according to your taste. + Please let us know if there is a platform you'd like us to support, we will do so if we can. Sample usage @@ -128,3 +133,4 @@ References: .. [4] U.Bauer, M.Kerber, J.Reininghaus: Clear and Compress: Computing Persistent Homology in Chunks. arXiv:1303.0477_ .. _arXiv:1303.0477: http://arxiv.org/pdf/1303.0477.pdf .. _`Persistent Homology Algorithm Toolkit`: https://bitbucket.org/phat/phat-code +.. _`python.org`:http://docs.python-guide.org/en/latest/starting/install/osx/ diff --git a/python/setup.py b/setup.py index f366e88..6d082d7 100644 --- a/python/setup.py +++ b/setup.py @@ -4,17 +4,16 @@ import sys import os.path from io import open -if sys.version_info < (2, 7, 11): - print("Sorry, PHAT requires Python 2.7.11 or later") +if sys.version_info < (2, 7, 12): + print("Sorry, PHAT requires Python 2.7.12 or later") sys.exit(1) ext_modules = [ Extension( '_phat', - ['_phat.cpp'], - include_dirs=['include', - '../include'], + ['python/_phat.cpp'], + include_dirs=['include'], language='c++', ), ] @@ -22,7 +21,7 @@ ext_modules = [ here = os.path.abspath(os.path.dirname(__file__)) # Get the long description from the README file -with open(os.path.join(here, 'README.rst'), encoding = 'utf8') as f: +with open(os.path.join(here, 'python', 'README.rst'), encoding = 'utf8') as f: long_description = f.read() class BuildExt(build_ext): @@ -45,6 +44,11 @@ class BuildExt(build_ext): ext.include_dirs.append(pybind11.get_include(user=True)) build_ext.build_extensions(self) +requires = ['pybind11'] + +if sys.version_info < (3,4,0): + requires.append('enum34') + setup( name='phat', version='0.0.1', @@ -56,8 +60,9 @@ setup( keywords='algebraic-topology PHAT distributed topology persistent-homology', long_description=long_description, ext_modules=ext_modules, - install_requires=['pybind11'], + install_requires=requires, cmdclass={'build_ext': BuildExt}, + package_dir={'':'python'}, py_modules = ['phat'], # packages = find_packages(exclude = ['doc', 'test']) ) |