@@ -437,7 +437,7 @@ def _install_path(self, wheel_file: mesonpy._wheelfile.WheelFile, origin: Path,
437
437
438
438
def _wheel_write_metadata (self , whl : mesonpy ._wheelfile .WheelFile ) -> None :
439
439
# add metadata
440
- whl .writestr (f'{ self .distinfo_dir } /METADATA' , self ._project . metadata )
440
+ whl .writestr (f'{ self .distinfo_dir } /METADATA' , bytes ( self ._metadata . as_rfc822 ()) )
441
441
whl .writestr (f'{ self .distinfo_dir } /WHEEL' , self .wheel )
442
442
if self .entrypoints_txt :
443
443
whl .writestr (f'{ self .distinfo_dir } /entry_points.txt' , self .entrypoints_txt )
@@ -839,11 +839,6 @@ def version(self) -> str:
839
839
"""Project version."""
840
840
return str (self ._metadata .version )
841
841
842
- @cached_property
843
- def metadata (self ) -> bytes :
844
- """Project metadata as an RFC822 message."""
845
- return bytes (self ._metadata .as_rfc822 ())
846
-
847
842
@property
848
843
def license_file (self ) -> Optional [pathlib .Path ]:
849
844
license_ = self ._metadata .license
@@ -911,8 +906,9 @@ def sdist(self, directory: Path) -> pathlib.Path:
911
906
# add PKG-INFO to dist file to make it a sdist
912
907
pkginfo_info = tarfile .TarInfo (f'{ dist_name } /PKG-INFO' )
913
908
pkginfo_info .mtime = time .time () # type: ignore[assignment]
914
- pkginfo_info .size = len (self .metadata )
915
- tar .addfile (pkginfo_info , fileobj = io .BytesIO (self .metadata ))
909
+ metadata = bytes (self ._metadata .as_rfc822 ())
910
+ pkginfo_info .size = len (metadata )
911
+ tar .addfile (pkginfo_info , fileobj = io .BytesIO (metadata ))
916
912
917
913
return sdist
918
914
0 commit comments