Home / File/ pdm_build.py — fastapi Source File

pdm_build.py — fastapi Source File

Architecture documentation for pdm_build.py, a python file in the fastapi codebase. 3 imports, 0 dependents.

File python FastAPI Routing 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  706530bd_904b_8fa8_8ced_cb545632c263["pdm_build.py"]
  af9b440f_13c4_d91e_f8ae_bfe199b060d2["os"]
  706530bd_904b_8fa8_8ced_cb545632c263 --> af9b440f_13c4_d91e_f8ae_bfe199b060d2
  0dda2280_3359_8460_301c_e98c77e78185["typing"]
  706530bd_904b_8fa8_8ced_cb545632c263 --> 0dda2280_3359_8460_301c_e98c77e78185
  15f6ba54_5e93_567a_f3f8_42915a78f08c["pdm.backend.hooks"]
  706530bd_904b_8fa8_8ced_cb545632c263 --> 15f6ba54_5e93_567a_f3f8_42915a78f08c
  style 706530bd_904b_8fa8_8ced_cb545632c263 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import os
from typing import Any

from pdm.backend.hooks import Context

TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE")


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

Dependencies

  • os
  • pdm.backend.hooks
  • typing

Frequently Asked Questions

What does pdm_build.py do?
pdm_build.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Routing subdomain.
What functions are defined in pdm_build.py?
pdm_build.py defines 1 function(s): pdm_build_initialize.
What does pdm_build.py depend on?
pdm_build.py imports 3 module(s): os, pdm.backend.hooks, typing.
Where is pdm_build.py in the architecture?
pdm_build.py is located at pdm_build.py (domain: FastAPI, subdomain: Routing).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free