Skip to content

Commit 0eff929

Browse files
committed
ENH: raise an error when a Meson installation path looks wrong
1 parent 615cae7 commit 0eff929

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mesonpy/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ def _map_meson_destination(destination: str) -> Tuple[Optional[str], pathlib.Pat
152152
if parts[0] in placeholders:
153153
return folder, pathlib.Path(*parts[1:])
154154
warnings.warn(f'Could not map installation path to an equivalent wheel directory: {destination!r}')
155+
if not re.match(r'^{\w+}$', parts[0]):
156+
raise RuntimeError('Meson installation path {destination!r} does not start with a placeholder. Meson bug!')
155157
return None, pathlib.Path(destination)
156158

157159

0 commit comments

Comments
 (0)