@@ -452,9 +452,6 @@ def _wheel_write_metadata(self, whl: mesonpy._wheelfile.WheelFile) -> None:
452
452
whl .write (self ._license_file , f'{ self .distinfo_dir } /{ os .path .basename (self ._license_file )} ' )
453
453
454
454
def build (self , directory : Path ) -> pathlib .Path :
455
- # ensure project is built
456
- self ._project .build ()
457
-
458
455
wheel_file = pathlib .Path (directory , f'{ self .name } .whl' )
459
456
with mesonpy ._wheelfile .WheelFile (wheel_file , 'w' ) as whl :
460
457
self ._wheel_write_metadata (whl )
@@ -480,11 +477,7 @@ def build(self, directory: Path) -> pathlib.Path:
480
477
return wheel_file
481
478
482
479
def build_editable (self , directory : Path , verbose : bool = False ) -> pathlib .Path :
483
- # ensure project is built
484
- self ._project .build ()
485
-
486
480
wheel_file = pathlib .Path (directory , f'{ self .name } .whl' )
487
-
488
481
with mesonpy ._wheelfile .WheelFile (wheel_file , 'w' ) as whl :
489
482
self ._wheel_write_metadata (whl )
490
483
whl .writestr (
@@ -905,11 +898,13 @@ def sdist(self, directory: Path) -> pathlib.Path:
905
898
906
899
def wheel (self , directory : Path ) -> pathlib .Path :
907
900
"""Generates a wheel (binary distribution) in the specified directory."""
901
+ self .build ()
908
902
file = self ._wheel_builder .build (directory )
909
903
assert isinstance (file , pathlib .Path )
910
904
return file
911
905
912
906
def editable (self , directory : Path ) -> pathlib .Path :
907
+ self .build ()
913
908
file = self ._wheel_builder .build_editable (directory , self ._editable_verbose )
914
909
assert isinstance (file , pathlib .Path )
915
910
return file
0 commit comments