enforcing the setup script from being run from the installation directory
parent
91fa7adf07
commit
03500b004b
|
@ -1,10 +1,19 @@
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
try:
|
try:
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils.core import setup, find_packages
|
from distutils.core import setup, find_packages
|
||||||
|
|
||||||
|
|
||||||
|
script_path = os.path.abspath(os.path.realpath(__file__))
|
||||||
|
install_path = os.path.abspath(os.path.realpath(os.path.join('${GTSAM_CYTHON_INSTALL_PATH}', 'setup.py')))
|
||||||
|
if script_path != install_path:
|
||||||
|
print('setup.py is being run from an unexpected location: "{script_path}"')
|
||||||
|
print('please run `make install` and run the script from there')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
packages = find_packages()
|
packages = find_packages()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
|
Loading…
Reference in New Issue