File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 4
4
import os
5
5
import shlex
6
6
7
+ from typing import List
8
+
7
9
import skbuild
8
10
9
11
__dir__ = pathlib .Path (__file__ ).resolve ().parent
@@ -30,6 +32,15 @@ def get_version(version_file: pathlib.Path) -> str:
30
32
return "{major}.{minor}.{patch}{pre}{post}{dev}" .format (** version_dict )
31
33
32
34
35
+ def get_cmake_args () -> List [str ]:
36
+ """Return the list of extra CMake arguments from the environment."""
37
+ cmake_args = shlex .split (os .environ .get ("CMAKE_ARGS" , "" ))
38
+ if "CONDA_BUILD" in os .environ :
39
+ install_re = re .compile (r"-D\s*CMAKE_INSTALL.*" )
40
+ cmake_args = [a for a in cmake_args if not install_re .search (a )]
41
+ return cmake_args
42
+
43
+
33
44
install_requires = ["numpy>=1.4" ]
34
45
if (sys .version_info .major == 3 ) and (sys .version_info .minor <= 6 ):
35
46
install_requires += ["typing_extensions" ]
@@ -52,7 +63,7 @@ def get_version(version_file: pathlib.Path) -> str:
52
63
# FIXME No way to pass cmake argument to scikit-build through pip (for now)
53
64
# https://github.com/scikit-build/scikit-build/issues/479
54
65
# So we read them from an environment variable
55
- cmake_args = shlex . split ( os . environ . get ( "CMAKE_ARGS" , "" ) ),
66
+ cmake_args = get_cmake_args ( ),
56
67
zip_safe = False ,
57
68
python_requires = ">=3.6" ,
58
69
install_requires = install_requires ,
You can’t perform that action at this time.
0 commit comments