From 36c27e7db145da50b74739ca4140cc043a61b3aa Mon Sep 17 00:00:00 2001 From: Cn Siva Date: Wed, 2 Apr 2025 16:30:04 +0530 Subject: [PATCH] code refractroing --- pdm_build.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pdm_build.py b/pdm_build.py index c83222b33..24f509964 100644 --- a/pdm_build.py +++ b/pdm_build.py @@ -7,14 +7,21 @@ TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "fastapi") def pdm_build_initialize(context: Context) -> None: + metadata = context.config.metadata + # Get custom config for the current package, from the env var config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][ "_internal-slim-build" - ]["packages"].get(TIANGOLO_BUILD_PACKAGE) + ]["packages"].get( + TIANGOLO_BUILD_PACKAGE + ) + if not config: return + project_config: Dict[str, Any] = config["project"] + # Override main [project] configs with custom configs for this package for key, value in project_config.items(): metadata[key] = value