From a58f9c0c8b0e3795697d4ebb986c11540c80b799 Mon Sep 17 00:00:00 2001 From: sigma67 <16363825+sigma67@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:28:05 +0100 Subject: [PATCH] fix: don't crash if there are no dependencies (#5) --- src/pdm_build_locked/_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pdm_build_locked/_utils.py b/src/pdm_build_locked/_utils.py index ba89458..d8370c3 100644 --- a/src/pdm_build_locked/_utils.py +++ b/src/pdm_build_locked/_utils.py @@ -112,6 +112,5 @@ def update_metadata_with_locked(metadata: dict[str, Any], root: Path) -> None: requirements.append(requirement_dict_to_string(package)) except UnsupportedRequirement as e: print(f"Skipping unsupported requirement: {e}") - if not requirements: - raise UnsupportedRequirement(f"No valid PEP 508 requirements are found for group {group}") + metadata.setdefault("optional-dependencies", {})[locked_group] = requirements