Raise an exception when source is anything else than PyPI

This commit is contained in:
Karolina Surma
2025-02-07 19:52:06 +01:00
parent eb09c25aca
commit c8d456d577
+2
View File
@@ -157,6 +157,8 @@ def source(config: ConfigFile, pypi_version: str) -> str:
if version_str == pypi_version:
source_macro_args += f" {version_str}"
return "%{pypi_source " + source_macro_args + "}"
else:
raise NotImplementedError("pyp2spec can only construct %pypi_source macros")
def pypi_version_or_macro(pypi_version: str) -> str: