@@ -22,12 +22,18 @@ def __init__(self, cfg: SubprojectConfig, path: pathlib.Path) -> None:
2222 with open (self .pyproject_path , "rb" ) as fp :
2323 self .pyproject_data = tomli .load (fp )
2424
25- self .requires = [
25+ self .build_requires = [
2626 Requirement (req ) for req in self .pyproject_data ["build-system" ]["requires" ]
2727 ]
2828
2929 self .pyproject_name : str = self .pyproject_data ["project" ]["name" ]
3030
31+ def is_semiwrap_project (self ) -> bool :
32+ return self .pyproject_data .get ("tool" , {}).get ("semiwrap" , None ) is not None
33+
34+ def is_meson_project (self ) -> bool :
35+ return (self .path / "meson.build" ).exists ()
36+
3137 #
3238 # Tasks
3339 #
@@ -37,18 +43,16 @@ def _cmd(self, *args: str, cwd=None):
3743 subprocess .check_call (args , cwd = cwd )
3844
3945 def _run_pip (self , * args : str , cwd = None ):
40- self ._cmd (sys .executable , "-m" , "pip" , "--disable-pip-version-check" , * args , cwd = cwd )
46+ self ._cmd (
47+ sys .executable , "-m" , "pip" , "--disable-pip-version-check" , * args , cwd = cwd
48+ )
4149
4250 def install_build_deps (self , * , wheel_path : pathlib .Path ):
43- self ._cmd (
44- sys .executable ,
45- "-m" ,
46- "pip" ,
51+ self ._run_pip (
4752 "install" ,
48- "--disable-pip-version-check" ,
4953 "--find-links" ,
5054 str (wheel_path ),
51- * [str (req ) for req in self .requires ],
55+ * [str (req ) for req in self .build_requires ],
5256 )
5357
5458 def develop (self ):
@@ -60,8 +64,9 @@ def uninstall(self):
6064 def update_init (self ):
6165 self ._cmd (
6266 sys .executable ,
63- "setup.py" ,
64- "update_init" ,
67+ "-m" ,
68+ "semiwrap" ,
69+ "update-init" ,
6570 cwd = self .path ,
6671 )
6772
0 commit comments