From 11061c1a4d348a1473327538bc3cd57b7db93f4e Mon Sep 17 00:00:00 2001 From: Rory Yorke Date: Tue, 18 Jun 2019 21:18:58 +0200 Subject: [PATCH 1/2] Build fixes: query numpy path directly; setup pyproject.toml for pip --- CMakeLists.txt | 2 +- MANIFEST.in | 1 + pyproject.toml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml diff --git a/CMakeLists.txt b/CMakeLists.txt index 63b32e03..6667eaeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ endif() # base site dir, use python installation for location specific includes execute_process( COMMAND "${PYTHON_EXECUTABLE}" -c - "from distutils.sysconfig import get_python_lib as pl; print(pl())" + "import os,numpy; print(os.path.dirname(numpy.__path__[0]))" OUTPUT_VARIABLE PYTHON_SITE OUTPUT_STRIP_TRAILING_WHITESPACE) if(WIN32) diff --git a/MANIFEST.in b/MANIFEST.in index 631e5327..c48269b2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,7 @@ include README.rst include MANIFEST.in include setup.cfg.in include CMakeLists.txt +include pyproject.toml include slycot/CMakeLists.txt include slycot/tests/CMakeLists.txt include slycot/*.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..3df57213 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools", "wheel", "scikit-build", "cmake", "numpy"] From 96e18768e8a27186131ed9de22813ff089cdff42 Mon Sep 17 00:00:00 2001 From: Rory Yorke Date: Wed, 19 Jun 2019 20:32:01 +0200 Subject: [PATCH 2/2] src_path is path to directory containing setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2289989e..db53bfd5 100644 --- a/setup.py +++ b/setup.py @@ -221,7 +221,7 @@ def run(self): def setup_package(): - src_path = os.path.dirname(os.path.abspath(sys.argv[0])) + src_path = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, src_path) # Rewrite the version file everytime