mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-29 01:00:51 -05:00
* ♻️ Add support for `pip install "fastapi[standard]"` and make `fastapi` not include the optional standard dependencies * 📝 Update docs to include new fastapi[standard] * ✨ Add new stub fastapi command that tells people to install fastapi[standard] * ✅ Add tests for new stub CLI * 🔧 Add new command fastapi in main fastapi project, for when fastapi-cli is not installed * ✏️ Fix types * 📝 Add note about quotes when installing fastapi[standard] * 📝 Update docs about standard extra dependencies * ⬆️ Upgrade fastapi-cli
21 lines
697 B
Python
21 lines
697 B
Python
import os
|
|
from typing import Any, Dict
|
|
|
|
from pdm.backend.hooks import Context
|
|
|
|
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)
|
|
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
|