@@ -775,17 +775,13 @@ def _get_config_key(self, key: str) -> Any:
775
775
value = value .get (part , {})
776
776
return value
777
777
778
- def _proc (self , * args : str ) -> None :
778
+ def _run (self , cmd : Sequence [ str ] ) -> None :
779
779
"""Invoke a subprocess."""
780
- print ('{cyan}{bold}+ {}{reset}' .format (' ' .join (args ), ** _STYLES ))
781
- r = subprocess .run (list ( args ) , env = self ._env , cwd = self ._build_dir )
780
+ print ('{cyan}{bold}+ {}{reset}' .format (' ' .join (cmd ), ** _STYLES ))
781
+ r = subprocess .run (cmd , env = self ._env , cwd = self ._build_dir )
782
782
if r .returncode != 0 :
783
783
raise SystemExit (r .returncode )
784
784
785
- def _meson (self , * args : str ) -> None :
786
- """Invoke Meson."""
787
- return self ._proc ('meson' , * args )
788
-
789
785
def _configure (self , reconfigure : bool = False ) -> None :
790
786
"""Configure Meson project."""
791
787
sys_paths = mesonpy ._introspection .SYSCONFIG_PATHS
@@ -812,7 +808,7 @@ def _configure(self, reconfigure: bool = False) -> None:
812
808
if reconfigure :
813
809
setup_args .insert (0 , '--reconfigure' )
814
810
815
- self ._meson ( ' setup' , * setup_args )
811
+ self ._run ([ 'meson' , ' setup' , * setup_args ] )
816
812
817
813
def _validate_metadata (self ) -> None :
818
814
"""Check the pyproject.toml metadata and see if there are any issues."""
@@ -877,7 +873,7 @@ def build_commands(self, install_dir: Optional[pathlib.Path] = None) -> Sequence
877
873
def build (self ) -> None :
878
874
"""Trigger the Meson build."""
879
875
for cmd in self .build_commands ():
880
- self ._meson ( * cmd [ 1 :] )
876
+ self ._run ( cmd )
881
877
882
878
@classmethod
883
879
@contextlib .contextmanager
@@ -1012,7 +1008,7 @@ def pep621(self) -> bool:
1012
1008
def sdist (self , directory : Path ) -> pathlib .Path :
1013
1009
"""Generates a sdist (source distribution) in the specified directory."""
1014
1010
# generate meson dist file
1015
- self ._meson ( ' dist' , '--allow-dirty' , '--no-tests' , '--formats' , 'gztar' , * self ._meson_args ['dist' ], )
1011
+ self ._run ([ 'meson' , ' dist' , '--allow-dirty' , '--no-tests' , '--formats' , 'gztar' , * self ._meson_args ['dist' ]] )
1016
1012
1017
1013
# move meson dist file to output path
1018
1014
dist_name = f'{ self .name } -{ self .version } '
0 commit comments