pdm_build_initialize() — fastapi Function Reference
Architecture documentation for the pdm_build_initialize() function in pdm_build.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 7120bc50_5d4e_ce0a_de6c_334109a15512["pdm_build_initialize()"] 706530bd_904b_8fa8_8ced_cb545632c263["pdm_build.py"] 7120bc50_5d4e_ce0a_de6c_334109a15512 -->|defined in| 706530bd_904b_8fa8_8ced_cb545632c263 style 7120bc50_5d4e_ce0a_de6c_334109a15512 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
pdm_build.py lines 9–40
def pdm_build_initialize(context: Context) -> None:
metadata = context.config.metadata
# Get main version
version = metadata["version"]
# Get custom config for the current package, from the env var
all_configs_config: dict[str, Any] = context.config.data["tool"]["tiangolo"][
"_internal-slim-build"
]["packages"]
if TIANGOLO_BUILD_PACKAGE not in all_configs_config:
return
config = all_configs_config[TIANGOLO_BUILD_PACKAGE]
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
# Get custom build config for the current package
build_config: dict[str, Any] = (
config.get("tool", {}).get("pdm", {}).get("build", {})
)
# Override PDM build config with custom build config for this package
for key, value in build_config.items():
context.config.build_config[key] = value
# Get main dependencies
dependencies: list[str] = metadata.get("dependencies", [])
# Sync versions in dependencies
new_dependencies = []
for dep in dependencies:
new_dep = f"{dep}>={version}"
new_dependencies.append(new_dep)
metadata["dependencies"] = new_dependencies
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does pdm_build_initialize() do?
pdm_build_initialize() is a function in the fastapi codebase, defined in pdm_build.py.
Where is pdm_build_initialize() defined?
pdm_build_initialize() is defined in pdm_build.py at line 9.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free