Skip to content

Commit 13f9a0f

Browse files
dnicolodirgommers
authored andcommitted
MAINT: avoid indirection in getting the package name
1 parent d5f12ec commit 13f9a0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mesonpy/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def _has_extension_modules(self) -> bool:
278278

279279
@property
280280
def normalized_name(self) -> str:
281-
return self._project.name.replace('-', '_')
281+
return self._metadata.name.replace('-', '_')
282282

283283
@property
284284
def basename(self) -> str:
@@ -425,7 +425,7 @@ def _install_path(self, wheel_file: mesonpy._wheelfile.WheelFile, origin: Path,
425425
# directory, in the form of a relative RPATH entry. meson-python
426426
# relocates the shared libraries to the $project.mesonpy.libs
427427
# folder. Rewrite the RPATH to point to that folder instead.
428-
libspath = os.path.relpath(f'.{self._project.name}.mesonpy.libs', destination.parent)
428+
libspath = os.path.relpath(f'.{self.normalized_name}.mesonpy.libs', destination.parent)
429429
mesonpy._rpath.fix_rpath(origin, libspath)
430430

431431
try:
@@ -469,7 +469,7 @@ def build(self, directory: Path) -> pathlib.Path:
469469
pass
470470
elif path == 'mesonpy-libs':
471471
# custom installation path for bundled libraries
472-
dst = pathlib.Path(f'.{self._project.name}.mesonpy.libs', dst)
472+
dst = pathlib.Path(f'.{self.normalized_name}.mesonpy.libs', dst)
473473
else:
474474
dst = pathlib.Path(self.data_dir, path, dst)
475475

0 commit comments

Comments
 (0)