File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 2
2
import platform
3
3
from pathlib import Path
4
4
from setuptools import setup , Extension
5
+ from warnings import warn
5
6
6
7
FORCE_BINARIES = "NOVA_FORCE" in os .environ and os .environ ["NOVA_FORCE" ].lower () == "binaries"
7
8
FORCE_BUILD_SOURCE = "NOVA_FORCE" in os .environ and os .environ ["NOVA_FORCE" ].lower () == "source"
32
33
elif not LOCAL_BINARIES .exists ():
33
34
raise RuntimeError (f"Not supported { platform .machine ()} architecture for binaries." )
34
35
36
+ if len (list (NOVA_PHYSICS .iterdir ())) == 0 or len (list (NOVA_PYTHON .iterdir ())) == 0 :
37
+ warn ("Submodules not initialized, performing additional cloning." )
38
+ if platform .system () == "Windows" :
39
+ os .system ("git.exe submodule init" )
40
+ os .system ("git.exe submodule update" )
41
+ else :
42
+ os .system ("git submodule init && git submodule update" )
43
+
35
44
36
45
def use_binaries ():
37
46
if FORCE_BINARIES :
@@ -103,7 +112,10 @@ def get_nova_sources():
103
112
104
113
def main ():
105
114
nova_to_link = str (get_nova_to_link ().relative_to (PACKAGE_DIR ))
106
- local_stubs = []
115
+ stubs_to_override = {REAL_PACKAGE / "__init__.pyi" : NOVA_PYTHON_STUB , REAL_PACKAGE / "_nova.pyi" : NOVA_PYTHON_STUB }
116
+
117
+ for write_to , read_from in stubs_to_override .items ():
118
+ write_to .write_text (read_from .read_text ())
107
119
108
120
extension = Extension (
109
121
name = "nova._nova" ,
You can’t perform that action at this time.
0 commit comments