diff --git a/README.md b/README.md index 4d908f07..3fb42830 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀 **FastAPI CLI** is a command line program `fastapi` that you can use to serve your FastAPI app, manage your FastAPI project, and more. -When you install FastAPI (e.g. with `pip install fastapi`), it includes a package called `fastapi-cli`, this package provides the `fastapi` command in the terminal. +When you install FastAPI (e.g. with `pip install "fastapi[standard]"`), it includes a package called `fastapi-cli`, this package provides the `fastapi` command in the terminal. To run your FastAPI app for development, you can use the `fastapi dev` command: diff --git a/pdm_build.py b/pdm_build.py index f442907d..67952131 100644 --- a/pdm_build.py +++ b/pdm_build.py @@ -1,5 +1,5 @@ import os -from typing import Any, Dict, List +from typing import Any, Dict from pdm.backend.hooks import Context @@ -11,29 +11,10 @@ def pdm_build_initialize(context: Context): # Get custom config for the current package, from the env var config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][ "_internal-slim-build" - ]["packages"][TIANGOLO_BUILD_PACKAGE] + ]["packages"].get(TIANGOLO_BUILD_PACKAGE) + if not config: + return project_config: Dict[str, Any] = config["project"] - # Get main optional dependencies, extras - optional_dependencies: Dict[str, List[str]] = metadata.get( - "optional-dependencies", {} - ) - # Get custom optional dependencies name to always include in this (non-slim) package - include_optional_dependencies: List[str] = config.get( - "include-optional-dependencies", [] - ) # 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", []) - # Add optional dependencies to the default dependencies for this (non-slim) package - for include_optional in include_optional_dependencies: - optional_dependencies_group = optional_dependencies.get(include_optional, []) - dependencies.extend(optional_dependencies_group) diff --git a/pyproject.toml b/pyproject.toml index 7d325e54..b1dc9cd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,6 @@ dependencies = [ [project.optional-dependencies] standard = [ - "fastapi", "uvicorn[standard] >= 0.15.0", ] @@ -69,14 +68,6 @@ source-includes = [ [tool.tiangolo._internal-slim-build.packages.fastapi-cli-slim.project] name = "fastapi-cli-slim" -[tool.tiangolo._internal-slim-build.packages.fastapi-cli] -# No default dependencies included for now -include-optional-dependencies = [] - -[tool.tiangolo._internal-slim-build.packages.fastapi-cli.project] -# No custom optional dependencies for now -# optional-dependencies = {} - [tool.pytest.ini_options] addopts = [ "--strict-config",