Skip to content

Commit 0a62c9b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into add-log-config-overides
2 parents d81ffd0 + 6990207 commit 0a62c9b

17 files changed

Lines changed: 328 additions & 595 deletions

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ internal:
1717
- .pre-commit-config.yaml
1818
- pdm_build.py
1919
- requirements*.txt
20+
- uv.lock
2021
- all-globs-to-all-files:
2122
- '!README.md'
2223
- '!src/**'

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
pyproject.toml
4949
uv.lock
5050
- name: Install Dependencies
51-
run: uv sync --locked
51+
run: uv sync --locked --extra standard
5252
- name: Run prek - pre-commit
5353
id: precommit
5454
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure

.github/workflows/test-redistribute.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ on:
1212
jobs:
1313
test-redistribute:
1414
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
package:
18-
- fastapi-cli-slim
19-
- fastapi-cli
2015
steps:
2116
- name: Dump GitHub context
2217
env:
@@ -33,8 +28,6 @@ jobs:
3328
- name: Install build dependencies
3429
run: pip install build
3530
- name: Build source distribution
36-
env:
37-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
3831
run: python -m build --sdist
3932
- name: Decompress source distribution
4033
run: |
@@ -44,8 +37,6 @@ jobs:
4437
run: |
4538
cd dist/fastapi_cli*/
4639
pip install --group tests --editable .[standard]
47-
env:
48-
TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }}
4940
- name: Run source distribution tests
5041
run: |
5142
cd dist/fastapi_cli*/

.github/workflows/test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,29 @@ jobs:
3030
matrix:
3131
os: [ ubuntu-latest, windows-latest, macos-latest ]
3232
python-version: ["3.14"]
33+
uv-resolution:
34+
- highest
3335
include:
34-
- python-version: "3.9"
35-
os: macos-latest
3636
- python-version: "3.10"
3737
os: ubuntu-latest
38+
uv-resolution: lowest-direct
3839
- python-version: "3.11"
3940
os: windows-latest
41+
uv-resolution: highest
4042
- python-version: "3.12"
4143
os: macos-latest
44+
uv-resolution: lowest-direct
4245
- python-version: "3.13"
4346
os: ubuntu-latest
47+
uv-resolution: highest
4448
- python-version: "3.13"
4549
os: windows-latest
50+
uv-resolution: highest
4651
fail-fast: false
4752
runs-on: ${{ matrix.os }}
4853
env:
4954
UV_PYTHON: ${{ matrix.python-version }}
55+
UV_RESOLUTION: ${{ matrix.uv-resolution }}
5056
steps:
5157
- name: Dump GitHub context
5258
env:
@@ -71,7 +77,7 @@ jobs:
7177
with:
7278
limit-access-to-actor: true
7379
- name: Install Dependencies
74-
run: uv sync --locked --no-dev --group tests --extra standard
80+
run: uv sync --no-dev --group tests --extra standard
7581
- run: mkdir coverage
7682
- name: Test
7783
run: uv run bash scripts/test.sh

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ repos:
2626
require_serial: true
2727
language: unsupported
2828
types: [python]
29+
30+
- id: local-mypy
31+
name: mypy check
32+
entry: uv run mypy src tests
33+
require_serial: true
34+
language: unsupported
35+
pass_filenames: false

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9
1+
3.10

fastapi-cli-slim/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# FastAPI CLI
2+
3+
<a href="https://github.com/fastapi/fastapi-cli/actions/workflows/test.yml" target="_blank">
4+
<img src="https://github.com/fastapi/fastapi-cli/actions/workflows/test.yml/badge.svg" alt="Test">
5+
</a>
6+
<a href="https://github.com/fastapi/fastapi-cli/actions/workflows/publish.yml" target="_blank">
7+
<img src="https://github.com/fastapi/fastapi-cli/actions/workflows/publish.yml/badge.svg" alt="Publish">
8+
</a>
9+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/fastapi-cli" target="_blank">
10+
<img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/fastapi-cli.svg" alt="Coverage">
11+
<a href="https://pypi.org/project/fastapi-cli" target="_blank">
12+
<img src="https://img.shields.io/pypi/v/fastapi-cli?color=%2334D058&label=pypi%20package" alt="Package version">
13+
</a>
14+
15+
---
16+
17+
**Source Code**: <a href="https://github.com/fastapi/fastapi-cli" target="_blank">https://github.com/fastapi/fastapi-cli</a>
18+
19+
---
20+
21+
Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀
22+
23+
## `fastapi-cli-slim`
24+
25+
⚠️ Do not install this package. ⚠️
26+
27+
This package, `fastapi-cli-slim`, does nothing other than depend on `fastapi-cli`.
28+
29+
You **should not** install this package.
30+
31+
Install instead:
32+
33+
```bash
34+
pip install "fastapi[standard]"
35+
```
36+
37+
or:
38+
39+
```bash
40+
pip install fastapi-cli
41+
```
42+
43+
This package is deprecated and will stop receiving any updates and published versions.
44+
45+
## License
46+
47+
This project is licensed under the terms of the MIT license.

pdm_build.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,38 @@
33

44
from pdm.backend.hooks import Context
55

6-
TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "fastapi-cli")
6+
TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE")
77

88

9-
def pdm_build_initialize(context: Context):
9+
def pdm_build_initialize(context: Context) -> None:
1010
metadata = context.config.metadata
11+
# Get main version
12+
version = metadata["version"]
1113
# Get custom config for the current package, from the env var
12-
config: dict[str, Any] = context.config.data["tool"]["tiangolo"][
14+
all_configs_config: dict[str, Any] = context.config.data["tool"]["tiangolo"][
1315
"_internal-slim-build"
14-
]["packages"].get(TIANGOLO_BUILD_PACKAGE)
15-
if not config:
16+
]["packages"]
17+
18+
if TIANGOLO_BUILD_PACKAGE not in all_configs_config:
1619
return
20+
21+
config = all_configs_config[TIANGOLO_BUILD_PACKAGE]
1722
project_config: dict[str, Any] = config["project"]
1823
# Override main [project] configs with custom configs for this package
1924
for key, value in project_config.items():
2025
metadata[key] = value
26+
# Get custom build config for the current package
27+
build_config: dict[str, Any] = (
28+
config.get("tool", {}).get("pdm", {}).get("build", {})
29+
)
30+
# Override PDM build config with custom build config for this package
31+
for key, value in build_config.items():
32+
context.config.build_config[key] = value
33+
# Get main dependencies
34+
dependencies: list[str] = metadata.get("dependencies", [])
35+
# Sync versions in dependencies
36+
new_dependencies = []
37+
for dep in dependencies:
38+
new_dep = f"{dep}>={version}"
39+
new_dependencies.append(new_dep)
40+
metadata["dependencies"] = new_dependencies

pyproject.toml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Run and manage FastAPI apps from the command line with FastAPI CL
55
authors = [
66
{name = "Sebastián Ramírez", email = "tiangolo@gmail.com"},
77
]
8-
requires-python = ">=3.9"
8+
requires-python = ">=3.10"
99
readme = "README.md"
1010
license = "MIT"
1111
license-files = ["LICENSE"]
@@ -24,15 +24,14 @@ classifiers = [
2424
"Framework :: FastAPI",
2525
"Intended Audience :: Developers",
2626
"Programming Language :: Python :: 3 :: Only",
27-
"Programming Language :: Python :: 3.9",
2827
"Programming Language :: Python :: 3.10",
2928
"Programming Language :: Python :: 3.11",
3029
"Programming Language :: Python :: 3.12",
3130
"Programming Language :: Python :: 3.13",
3231
"Programming Language :: Python :: 3.14",
3332
]
3433
dependencies = [
35-
"typer >= 0.15.1",
34+
"typer >= 0.16.0",
3635
"uvicorn[standard] >= 0.15.0",
3736
"rich-toolkit >= 0.14.8",
3837
"tomli >= 2.0.0; python_version < '3.11'"
@@ -47,7 +46,7 @@ standard-no-fastapi-cloud-cli = [
4746
"uvicorn[standard] >= 0.15.0",
4847
]
4948
new = [
50-
"fastapi-new >= 0.0.2 ; python_version >= '3.10'",
49+
"fastapi-new >= 0.0.2",
5150
]
5251

5352
[project.urls]
@@ -67,10 +66,10 @@ github-actions = [
6766
]
6867
tests = [
6968
"coverage[toml]>=6.2,<8.0",
70-
"fastapi-slim>=0.128.0",
69+
"fastapi>=0.128.0",
7170
"mypy==1.19.1",
72-
"pytest>=4.4.0,<10.0.0",
73-
"ruff==0.14.10",
71+
"pytest>=7.4.0,<10.0.0",
72+
"ruff==0.15.1",
7473
"uvicorn>=0.39.0",
7574
]
7675

@@ -91,6 +90,29 @@ source-includes = [
9190

9291
[tool.tiangolo._internal-slim-build.packages.fastapi-cli-slim.project]
9392
name = "fastapi-cli-slim"
93+
readme = "fastapi-cli-slim/README.md"
94+
dependencies = [
95+
"fastapi-cli",
96+
]
97+
optional-dependencies = {}
98+
scripts = {}
99+
100+
[tool.tiangolo._internal-slim-build.packages.fastapi-cli-slim.tool.pdm.build]
101+
# excludes needs to explicitly exclude the top level python packages,
102+
# otherwise PDM includes them by default
103+
# A "*" glob pattern can't be used here because in PDM internals, the patterns are put
104+
# in a set (unordered, order varies) and each excluded file is assigned one of the
105+
# glob patterns that matches, as the set is unordered, the matched pattern could be "*"
106+
# independent of the order here. And then the internal code would give it a lower score
107+
# than the one for a default included file.
108+
# By not using "*" and explicitly excluding the top level packages, they get a higher
109+
# score than the default inclusion
110+
excludes = ["src", "tests", "pdm_build.py"]
111+
# source-includes needs to explicitly define some value because PDM will check the
112+
# truthy value of the list, and if empty, will include some defaults, including "tests",
113+
# an empty string doesn't match anything, but makes the list truthy, so that PDM
114+
# doesn't override it during the build.
115+
source-includes = [""]
94116

95117
[tool.pytest.ini_options]
96118
addopts = [

release-notes.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,61 @@
44

55
### Internal
66

7+
* ⬆ Bump fastapi-cloud-cli from 0.12.0 to 0.13.0. PR [#315](https://github.com/fastapi/fastapi-cli/pull/315) by [@dependabot[bot]](https://github.com/apps/dependabot).
8+
* ⬆ Bump fastapi-new from 0.0.4 to 0.0.5. PR [#314](https://github.com/fastapi/fastapi-cli/pull/314) by [@dependabot[bot]](https://github.com/apps/dependabot).
9+
* ⬆ Bump fastapi from 0.128.8 to 0.129.0. PR [#313](https://github.com/fastapi/fastapi-cli/pull/313) by [@dependabot[bot]](https://github.com/apps/dependabot).
10+
* ⬆ Bump typer from 0.23.1 to 0.24.0. PR [#312](https://github.com/fastapi/fastapi-cli/pull/312) by [@dependabot[bot]](https://github.com/apps/dependabot).
11+
* ⬆ Bump uvicorn from 0.40.0 to 0.41.0. PR [#311](https://github.com/fastapi/fastapi-cli/pull/311) by [@dependabot[bot]](https://github.com/apps/dependabot).
12+
13+
## 0.0.23
14+
15+
### Breaking Changes
16+
17+
* ➖ Drop support for Python 3.9. PR [#309](https://github.com/fastapi/fastapi-cli/pull/309) by [@tiangolo](https://github.com/tiangolo).
18+
19+
### Refactors
20+
21+
* 🎨 Update format and types for Python 3.10. PR [#310](https://github.com/fastapi/fastapi-cli/pull/310) by [@tiangolo](https://github.com/tiangolo).
22+
23+
## 0.0.22
24+
25+
### Internal
26+
27+
* 👷 Run tests with lower bound uv sync, update minimum dependencies. PR [#299](https://github.com/fastapi/fastapi-cli/pull/299) by [@YuriiMotov](https://github.com/YuriiMotov).
28+
* ⬆ Bump fastapi-cloud-cli from 0.11.0 to 0.12.0. PR [#308](https://github.com/fastapi/fastapi-cli/pull/308) by [@dependabot[bot]](https://github.com/apps/dependabot).
29+
* ⬆ Bump prek from 0.3.2 to 0.3.3. PR [#307](https://github.com/fastapi/fastapi-cli/pull/307) by [@dependabot[bot]](https://github.com/apps/dependabot).
30+
* ⬆ Bump typer from 0.23.0 to 0.23.1. PR [#306](https://github.com/fastapi/fastapi-cli/pull/306) by [@dependabot[bot]](https://github.com/apps/dependabot).
31+
* ⬆ Bump ruff from 0.15.0 to 0.15.1. PR [#305](https://github.com/fastapi/fastapi-cli/pull/305) by [@dependabot[bot]](https://github.com/apps/dependabot).
32+
* ⬆ Bump rich-toolkit from 0.19.3 to 0.19.4. PR [#304](https://github.com/fastapi/fastapi-cli/pull/304) by [@dependabot[bot]](https://github.com/apps/dependabot).
33+
* ⬆ Bump typer from 0.21.2 to 0.23.0. PR [#302](https://github.com/fastapi/fastapi-cli/pull/302) by [@dependabot[bot]](https://github.com/apps/dependabot).
34+
* ⬆ Bump rich-toolkit from 0.19.2 to 0.19.3. PR [#303](https://github.com/fastapi/fastapi-cli/pull/303) by [@dependabot[bot]](https://github.com/apps/dependabot).
35+
* ➕ Replace test dependency on `fastapi-slim` with `fastapi`. PR [#301](https://github.com/fastapi/fastapi-cli/pull/301) by [@musicinmybrain](https://github.com/musicinmybrain).
36+
37+
## 0.0.21
38+
39+
### Internal
40+
41+
* 👷 Update build setup for `fastapi-cli-slim`, deprecate it, and make it only depend on `fastapi-cli`. PR [#300](https://github.com/fastapi/fastapi-cli/pull/300) by [@tiangolo](https://github.com/tiangolo).
42+
* ⬆ Bump typer from 0.21.1 to 0.21.2. PR [#298](https://github.com/fastapi/fastapi-cli/pull/298) by [@dependabot[bot]](https://github.com/apps/dependabot).
43+
* ⬆ Bump fastapi-slim from 0.128.6 to 0.128.7. PR [#297](https://github.com/fastapi/fastapi-cli/pull/297) by [@dependabot[bot]](https://github.com/apps/dependabot).
44+
* ⬆ Bump rich-toolkit from 0.19.0 to 0.19.2. PR [#296](https://github.com/fastapi/fastapi-cli/pull/296) by [@dependabot[bot]](https://github.com/apps/dependabot).
45+
* ⬆ Bump rich-toolkit from 0.18.1 to 0.19.0. PR [#293](https://github.com/fastapi/fastapi-cli/pull/293) by [@dependabot[bot]](https://github.com/apps/dependabot).
46+
* ⬆ Bump fastapi-slim from 0.128.5 to 0.128.6. PR [#294](https://github.com/fastapi/fastapi-cli/pull/294) by [@dependabot[bot]](https://github.com/apps/dependabot).
47+
* ⬆ Bump fastapi-slim from 0.128.2 to 0.128.5. PR [#292](https://github.com/fastapi/fastapi-cli/pull/292) by [@dependabot[bot]](https://github.com/apps/dependabot).
48+
* ⬆ Bump prek from 0.3.1 to 0.3.2. PR [#291](https://github.com/fastapi/fastapi-cli/pull/291) by [@dependabot[bot]](https://github.com/apps/dependabot).
49+
* ⬆ Bump ruff from 0.14.14 to 0.15.0. PR [#288](https://github.com/fastapi/fastapi-cli/pull/288) by [@dependabot[bot]](https://github.com/apps/dependabot).
50+
* ⬆ Bump fastapi-slim from 0.128.1 to 0.128.2. PR [#290](https://github.com/fastapi/fastapi-cli/pull/290) by [@dependabot[bot]](https://github.com/apps/dependabot).
51+
* ⬆ Bump fastapi-slim from 0.128.0 to 0.128.1. PR [#289](https://github.com/fastapi/fastapi-cli/pull/289) by [@dependabot[bot]](https://github.com/apps/dependabot).
52+
* 👷 Run mypy by pre-commit. PR [#287](https://github.com/fastapi/fastapi-cli/pull/287) by [@YuriiMotov](https://github.com/YuriiMotov).
53+
* ⬆ Bump rich-toolkit from 0.17.2 to 0.18.1. PR [#286](https://github.com/fastapi/fastapi-cli/pull/286) by [@dependabot[bot]](https://github.com/apps/dependabot).
54+
* ⬆ Bump prek from 0.3.0 to 0.3.1. PR [#285](https://github.com/fastapi/fastapi-cli/pull/285) by [@dependabot[bot]](https://github.com/apps/dependabot).
55+
* ⬆ Bump rich-toolkit from 0.17.1 to 0.17.2. PR [#284](https://github.com/fastapi/fastapi-cli/pull/284) by [@dependabot[bot]](https://github.com/apps/dependabot).
56+
* ⬆ Bump ruff from 0.14.13 to 0.14.14. PR [#283](https://github.com/fastapi/fastapi-cli/pull/283) by [@dependabot[bot]](https://github.com/apps/dependabot).
57+
* 🔧 Ensure that an edit to `uv.lock` gets the `internal` label. PR [#282](https://github.com/fastapi/fastapi-cli/pull/282) by [@svlandeg](https://github.com/svlandeg).
58+
* ⬆ Bump prek from 0.2.30 to 0.3.0. PR [#281](https://github.com/fastapi/fastapi-cli/pull/281) by [@dependabot[bot]](https://github.com/apps/dependabot).
59+
* ⬆ Bump prek from 0.2.27 to 0.2.30. PR [#280](https://github.com/fastapi/fastapi-cli/pull/280) by [@dependabot[bot]](https://github.com/apps/dependabot).
60+
* ⬆ Bump fastapi-cloud-cli from 0.8.0 to 0.11.0. PR [#278](https://github.com/fastapi/fastapi-cli/pull/278) by [@dependabot[bot]](https://github.com/apps/dependabot).
61+
* ⬆ Bump ruff from 0.14.10 to 0.14.13. PR [#279](https://github.com/fastapi/fastapi-cli/pull/279) by [@dependabot[bot]](https://github.com/apps/dependabot).
762
* ⬆️ Migrate to uv. PR [#275](https://github.com/fastapi/fastapi-cli/pull/275) by [@DoctorJohn](https://github.com/DoctorJohn).
863
* ⬆ Bump mypy from 1.14.1 to 1.19.1. PR [#261](https://github.com/fastapi/fastapi-cli/pull/261) by [@dependabot[bot]](https://github.com/apps/dependabot).
964
* ⬆ Update pytest requirement from <9.0.0,>=4.4.0 to >=4.4.0,<10.0.0. PR [#273](https://github.com/fastapi/fastapi-cli/pull/273) by [@dependabot[bot]](https://github.com/apps/dependabot).

0 commit comments

Comments
 (0)