Skip to content

Commit a37474e

Browse files
authored
👷 Switch to dynamic versioning with pdm build system (#11)
1 parent cdb136c commit a37474e

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

‎pyproject.toml‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "fastapi-new"
3-
version = "0.0.1"
3+
dynamic = ["version"]
44
license = "MIT"
55
license-files = ["LICENSE"]
66
description = "Create a new FastAPI project in one command"
@@ -56,12 +56,16 @@ Issues = "https://github.com/fastapi/fastapi-new/issues"
5656
Changelog = "https://github.com/fastapi/fastapi-new/release-notes.md"
5757

5858
[build-system]
59-
requires = ["uv_build>=0.9.1,<0.10.0"]
60-
build-backend = "uv_build"
59+
requires = ["pdm-backend"]
60+
build-backend = "pdm.backend"
6161

6262
[tool.mypy]
6363
strict = true
6464

65+
[tool.pdm]
66+
version = { source = "file", path = "src/fastapi_new/__init__.py" }
67+
distribution = true
68+
6569
[tool.pytest.ini_options]
6670
addopts = [
6771
"--strict-config",
@@ -109,9 +113,9 @@ ignore = [
109113
# Preserve types, even if a file imports `from __future__ import annotations`.
110114
keep-runtime-typing = true
111115

112-
[tool.uv.build-backend]
113-
source-include = [
114-
"tests/**",
116+
[tool.pdm.build]
117+
source-includes = [
118+
"tests/",
115119
"requirements*.txt",
116-
"scripts/**",
120+
"scripts/",
117121
]
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
from importlib.metadata import version
2-
3-
__version__ = version("fastapi-new")
1+
__version__ = "0.0.1"

0 commit comments

Comments
 (0)