Skip to content

Commit be3a0eb

Browse files
committed
Use poetry plugin as build system backend
1 parent 29bd23a commit be3a0eb

2 files changed

Lines changed: 870 additions & 864 deletions

File tree

pyproject.toml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,25 @@ homepage = "https://github.com/elapouya/python-docx-template"
4141
repository = "https://github.com/elapouya/python-docx-template.git"
4242
document = "https://docxtpl.readthedocs.org"
4343

44-
[tool.pdm]
45-
version = {source="file", path="docxtpl/__init__.py"}
46-
4744
[tool.poetry]
4845
version = '0.0.0'
4946

50-
[tool.poetry-plugin-version]
47+
[tool.poetry.requires-plugins]
48+
poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
49+
50+
[tool.poetry-dynamic-versioning]
51+
enable = true
52+
53+
[tool.poetry-dynamic-versioning.from-file]
5154
source = "docxtpl/__init__.py"
55+
pattern = '__version__ = "(.+)"'
56+
57+
[tool.pdm.version]
58+
source = "file"
59+
path = "docxtpl/__init__.py"
60+
61+
[tool.pdm.scripts]
62+
style = "flake8 . --count --max-line-length=127 --show-source --statistics --exclude .venv,__pycache__"
5263

5364
[tool.mypy]
5465
pretty = true
@@ -62,10 +73,5 @@ module = ["docxcompose.*"]
6273
ignore_missing_imports = true
6374

6475
[build-system]
65-
requires = ["pdm-backend"]
66-
build-backend = "pdm.backend"
67-
68-
[tool.pdm.scripts]
69-
style = "flake8 . --count --max-line-length=127 --show-source --statistics --exclude .venv,__pycache__"
70-
type = "mypy ."
71-
check = {composite = ["style", "type {args}"]}
76+
requires = ["poetry-core", "poetry-dynamic-versioning >=1.0.0,<2.0.0"]
77+
build-backend = "poetry_dynamic_versioning.backend"

0 commit comments

Comments
 (0)