Browse Source

code refractroing

pull/13575/head
Cn Siva 3 days ago
parent
commit
36c27e7db1
  1. 9
      pdm_build.py

9
pdm_build.py

@ -7,14 +7,21 @@ TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "fastapi")
def pdm_build_initialize(context: Context) -> None: def pdm_build_initialize(context: Context) -> None:
metadata = context.config.metadata metadata = context.config.metadata
# Get custom config for the current package, from the env var # Get custom config for the current package, from the env var
config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][ config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][
"_internal-slim-build" "_internal-slim-build"
]["packages"].get(TIANGOLO_BUILD_PACKAGE) ]["packages"].get(
TIANGOLO_BUILD_PACKAGE
)
if not config: if not config:
return return
project_config: Dict[str, Any] = config["project"] project_config: Dict[str, Any] = config["project"]
# Override main [project] configs with custom configs for this package # Override main [project] configs with custom configs for this package
for key, value in project_config.items(): for key, value in project_config.items():
metadata[key] = value metadata[key] = value

Loading…
Cancel
Save