From 03500b004bc5e16e48725a3d3500b0f25bab43dd Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Mon, 11 Mar 2019 15:02:11 +0000 Subject: [PATCH] enforcing the setup script from being run from the installation directory --- cython/setup.py.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cython/setup.py.in b/cython/setup.py.in index a4c96f1b8..0c37cd660 100644 --- a/cython/setup.py.in +++ b/cython/setup.py.in @@ -1,10 +1,19 @@ import os +import sys try: from setuptools import setup, find_packages except ImportError: 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() setup(