diff --git a/src/poetry/packages/locker.py b/src/poetry/packages/locker.py index e57e60b83b7..7cfdcc10c9f 100644 --- a/src/poetry/packages/locker.py +++ b/src/poetry/packages/locker.py @@ -127,6 +127,7 @@ def locked_repository(self) -> Repository: source_url=url, source_reference=source.get("reference"), source_resolved_reference=source.get("resolved_reference"), + source_subdirectory=source.get("subdirectory"), ) package.description = info.get("description", "") package.category = info.get("category", "main") @@ -620,6 +621,9 @@ def _dump_package(self, package: Package) -> dict[str, Any]: if package.source_resolved_reference: data["source"]["resolved_reference"] = package.source_resolved_reference + if package.source_subdirectory: + data["source"]["subdirectory"] = package.source_subdirectory + if package.source_type in ["directory", "git"]: data["develop"] = package.develop