@@ -476,14 +476,15 @@ def build(self, directory: Path) -> pathlib.Path:
476
476
477
477
return wheel_file
478
478
479
- def build_editable (self , directory : Path , verbose : bool = False ) -> pathlib .Path :
479
+ def build_editable (self , directory : Path , source_dir : pathlib .Path , build_dir : pathlib .Path ,
480
+ build_command : List [str ], verbose : bool = False ) -> pathlib .Path :
481
+
480
482
wheel_file = pathlib .Path (directory , f'{ self .name } .whl' )
481
483
with mesonpy ._wheelfile .WheelFile (wheel_file , 'w' ) as whl :
482
484
self ._wheel_write_metadata (whl )
483
485
whl .writestr (
484
486
f'{ self .distinfo_dir } /direct_url.json' ,
485
- self ._source_dir .as_uri ().encode ('utf-8' ),
486
- )
487
+ source_dir .as_uri ().encode ('utf-8' ))
487
488
488
489
# install loader module
489
490
loader_module_name = f'_{ self .normalized_name .replace ("." , "_" )} _editable_loader'
@@ -492,8 +493,8 @@ def build_editable(self, directory: Path, verbose: bool = False) -> pathlib.Path
492
493
read_binary ('mesonpy' , '_editable.py' ) + textwrap .dedent (f'''
493
494
install(
494
495
{ self .top_level_modules !r} ,
495
- { os .fspath (self . _build_dir )!r} ,
496
- { self . _project . _build_command !r} ,
496
+ { os .fspath (build_dir )!r} ,
497
+ { build_command !r} ,
497
498
{ verbose !r} ,
498
499
)''' ).encode ('utf-8' ))
499
500
@@ -905,7 +906,7 @@ def wheel(self, directory: Path) -> pathlib.Path:
905
906
906
907
def editable (self , directory : Path ) -> pathlib .Path :
907
908
self .build ()
908
- file = self ._wheel_builder .build_editable (directory , self ._editable_verbose )
909
+ file = self ._wheel_builder .build_editable (directory , self ._source_dir , self . _build_dir , self . _build_command , self . _editable_verbose )
909
910
assert isinstance (file , pathlib .Path )
910
911
return file
911
912
0 commit comments