diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f52fe0c47529d7aeb29b87a7b97809247599312..b13f56ab70db6adcce7ae5312aeed41b943a8884 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,10 @@ add_custom_target(moose ALL) set(PYMOOSE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/moose-core") set(PYMOOSE_BUILD_DIR ${CMAKE_BINARY_DIR}/__moose-core_build) + +# NOTE: new setuptools does not install python module to this directory unless +# it supports .pth file or PYTHONPATH points to it. Make sure when moose-core is +# installing into user_specified path, set PYTHONPATH to this directory. set(PYMOOSE_INSTALL_DIR ${CMAKE_BINARY_DIR}/__moose-core_install) if(WITH_GUI) @@ -105,8 +109,8 @@ if(WITH_GUI) endif() -## moose-gui -## TODO: moose-gui should be a python module. +# moose-gui +# TODO: moose-gui should be a python module. set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui) install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/ diff --git a/moose-core/CMakeLists.txt b/moose-core/CMakeLists.txt index 84c80e4722426f96871d16fc20f683bfa95b3941..e202e7b87ed2095731b7754c5afed9059ab02918 100644 --- a/moose-core/CMakeLists.txt +++ b/moose-core/CMakeLists.txt @@ -434,7 +434,7 @@ endif( ) # --user to install in user home. install(CODE "execute_process( - COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py install ${EXTRA_ARGS} ${PYMOOSE_EXTRA_INSTALL_ARGS} + COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py install -f ${EXTRA_ARGS} ${PYMOOSE_EXTRA_INSTALL_ARGS} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python )" ) diff --git a/moose-core/python/setup.cmake.py b/moose-core/python/setup.cmake.py index ebce90693b110574df448678fab379642e644880..49eb95d6e0cef6e24bf98ca4a5d65dba2686363b 100644 --- a/moose-core/python/setup.cmake.py +++ b/moose-core/python/setup.cmake.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- -"""setup.py: -Script to install python targets. +""" +setup.cmake.py: -NOTE: This script is to be called by CMake. Not intended to be used standalone. +Script to install python targets by cmake. +DO NOT USE IT DIRECTLY. Only `cmake` build system should use it directly. """ __author__ = "Dilawar Singh" @@ -20,33 +21,32 @@ import os import sys try: - from setuptools import setup + from setuptools import setup except Exception as e: - from distutils.core import setup + from distutils.core import setup script_dir = os.path.dirname( os.path.abspath( __file__ ) ) -version = '3.2pre1' - +version = '3.2.0-git' try: with open( os.path.join( script_dir, 'VERSION'), 'r' ) as f: version = f.read( ) except Exception as e: - print( 'Failed to read VERSION %s' % e ) + print( 'Failed to read VERSION from file due to: %s' % e ) print( 'Using default %s' % version ) try: import importlib.machinery suffix = importlib.machinery.EXTENSION_SUFFIXES[0] except Exception as e: - print( '[WARN] Failed to determine importlib suffix' ) + print( '[WARN] Failed to determine importlib suffix due to %s' % e ) suffix = '.so' setup( name='pymoose', version=version, description='Python scripting interface of MOOSE Simulator (https://moose.ncbs.res.in)', - author='MOOSERes', + author='See AUTHORS.md at https://github.com/BhallaLab/moose', author_email='bhalla@ncbs.res.in', maintainer='Dilawar Singh', maintainer_email='dilawars@ncbs.res.in', @@ -61,9 +61,11 @@ setup( , 'moose.chemUtil' , 'moose.chemMerge' ], - install_requires = [ 'python-libsbml', 'numpy' ], + install_requires = [ 'python-libsbml', 'numpy' ], package_dir = { 'moose' : 'moose', 'rdesigneur' : 'rdesigneur' }, - package_data = { 'moose' : ['_moose' + suffix, 'neuroml2/schema/NeuroMLCoreDimensions.xml'] }, - ) + package_data = { + 'moose' : ['_moose' + suffix, 'neuroml2/schema/NeuroMLCoreDimensions.xml'] + }, + )