Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
27 changes: 4 additions & 23 deletions pdm_build.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Any, Dict, List
from typing import Any, Dict

from pdm.backend.hooks import Context

Expand All @@ -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)
9 changes: 0 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies = [

[project.optional-dependencies]
standard = [
"fastapi",
"uvicorn[standard] >= 0.15.0",
]

Expand Down Expand Up @@ -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",
Expand Down