diff --git a/cython/CMakeLists.txt b/cython/CMakeLists.txt index ca5c0ecfb..400e96e13 100644 --- a/cython/CMakeLists.txt +++ b/cython/CMakeLists.txt @@ -28,6 +28,9 @@ if (GTSAM_INSTALL_CYTHON_TOOLBOX) ) endif() + file(READ "${PROJECT_SOURCE_DIR}/cython/requirements.txt" CYTHON_INSTALL_REQUIREMENTS) + file(READ "${PROJECT_SOURCE_DIR}/README.md" README_CONTENTS) + # Install the custom-generated __init__.py # This is to make the build/cython/gtsam folder a python package, so gtsam can be found while wrapping gtsam_unstable configure_file(${PROJECT_SOURCE_DIR}/cython/gtsam/__init__.py ${PROJECT_BINARY_DIR}/cython/gtsam/__init__.py COPYONLY) diff --git a/cython/setup.py.in b/cython/setup.py.in index 3161c36e7..0e22dbf11 100644 --- a/cython/setup.py.in +++ b/cython/setup.py.in @@ -14,7 +14,7 @@ setup( version='${GTSAM_VERSION_STRING}', # https://www.python.org/dev/peps/pep-0440/ license='Simplified BSD license', keywords='slam sam', - long_description=open('${PROJECT_SOURCE_DIR}/README.md', 'r').read(), + long_description='''${README_CONTENTS}''', # https://pypi.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -30,5 +30,7 @@ setup( [f for f in os.listdir(package.replace('.', os.path.sep)) if os.path.splitext(f)[1] in ('.so', '.dll')] for package in packages }, - install_requires=open('${PROJECT_SOURCE_DIR}/cython/requirements.txt', 'r').read().splitlines() + install_requires=[line.strip() for line in ''' +${CYTHON_INSTALL_REQUIREMENTS} +'''.splitlines() if len(line) > 0 and not line.strip().startswith('#')] )