Skip to content

Commit 365e196

Browse files
refactor(templates): Split pyproject.toml.jinja into pdm and poetry specific files.
1 parent e934fd6 commit 365e196

File tree

8 files changed

+46
-52
lines changed

8 files changed

+46
-52
lines changed

end_to_end_tests/docstrings-on-attributes-golden-record/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ description = "A client library for accessing My Test API"
55
authors = []
66
readme = "README.md"
77
packages = [
8-
{include = "my_test_api_client"},
8+
{ include = "my_test_api_client" },
99
]
1010
include = ["CHANGELOG.md", "my_test_api_client/py.typed"]
1111

12-
1312
[tool.poetry.dependencies]
1413
python = "^3.9"
1514
httpx = ">=0.23.0,<0.29.0"

end_to_end_tests/golden-record/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ description = "A client library for accessing My Test API"
55
authors = []
66
readme = "README.md"
77
packages = [
8-
{include = "my_test_api_client"},
8+
{ include = "my_test_api_client" },
99
]
1010
include = ["CHANGELOG.md", "my_test_api_client/py.typed"]
1111

12-
1312
[tool.poetry.dependencies]
1413
python = "^3.9"
1514
httpx = ">=0.23.0,<0.29.0"

end_to_end_tests/literal-enums-golden-record/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ description = "A client library for accessing My Enum API"
55
authors = []
66
readme = "README.md"
77
packages = [
8-
{include = "my_enum_api_client"},
8+
{ include = "my_enum_api_client" },
99
]
1010
include = ["CHANGELOG.md", "my_enum_api_client/py.typed"]
1111

12-
1312
[tool.poetry.dependencies]
1413
python = "^3.9"
1514
httpx = ">=0.23.0,<0.29.0"

end_to_end_tests/metadata_snapshots/poetry.pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ description = "A client library for accessing Test 3.1 Features"
55
authors = []
66
readme = "README.md"
77
packages = [
8-
{include = "test_3_1_features_client"},
8+
{ include = "test_3_1_features_client" },
99
]
1010
include = ["CHANGELOG.md", "test_3_1_features_client/py.typed"]
1111

12-
1312
[tool.poetry.dependencies]
1413
python = "^3.9"
1514
httpx = ">=0.23.0,<0.29.0"

end_to_end_tests/test-3-1-golden-record/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ description = "A client library for accessing Test 3.1 Features"
55
authors = []
66
readme = "README.md"
77
packages = [
8-
{include = "test_3_1_features_client"},
8+
{ include = "test_3_1_features_client" },
99
]
1010
include = ["CHANGELOG.md", "test_3_1_features_client/py.typed"]
1111

12-
1312
[tool.poetry.dependencies]
1413
python = "^3.9"
1514
httpx = ">=0.23.0,<0.29.0"
Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,9 @@
11
{% set poetry = meta == "poetry" %}
22
{% set pdm = meta == "pdm" %}
3-
{% if poetry or pdm %}
4-
{% if poetry %}[tool.poetry]
5-
{% elif pdm %}[project]
6-
{% endif %}
7-
name = "{{ project_name }}"
8-
version = "{{ package_version }}"
9-
description = "{{ package_description }}"
10-
authors = []
11-
readme = "README.md"
12-
{% if pdm %}requires-python = ">=3.9,<4.0"{% endif %}
13-
{% if poetry %}
14-
packages = [
15-
{include = "{{ package_name }}"},
16-
]
17-
include = ["CHANGELOG.md", "{{ package_name }}/py.typed"]
18-
{% endif %}
19-
20-
{% if pdm %}
21-
dependencies = [
22-
"httpx>=0.23.0,<0.29.0",
23-
"attrs>=22.2.0",
24-
"python-dateutil>=2.8.0",
25-
]
26-
27-
[tool.pdm]
28-
distribution = true
29-
{% endif %}
30-
{% if poetry %}
31-
32-
[tool.poetry.dependencies]
33-
python = "^3.9"
34-
httpx = ">=0.23.0,<0.29.0"
35-
attrs = ">=22.2.0"
36-
python-dateutil = "^2.8.0"
37-
{% endif %}
38-
39-
[build-system]
403
{% if poetry %}
41-
requires = ["poetry-core>=1.0.0"]
42-
build-backend = "poetry.core.masonry.api"
4+
{% include "pyproject_poetry.toml.jinja" %}
435
{% elif pdm %}
44-
requires = ["pdm-backend"]
45-
build-backend = "pdm.backend"
6+
{% include "pyproject_pdm.toml.jinja" %}
467
{% endif %}
47-
{% endif %}{# poetry or pdm #}
488

499
{% include "pyproject_ruff.toml.jinja" %}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[project]
2+
name = "{{ project_name }}"
3+
version = "{{ package_version }}"
4+
description = "{{ package_description }}"
5+
authors = []
6+
readme = "README.md"
7+
requires-python = ">=3.9,<4.0"
8+
dependencies = [
9+
"httpx>=0.23.0,<0.29.0",
10+
"attrs>=22.2.0",
11+
"python-dateutil>=2.8.0",
12+
]
13+
14+
[tool.pdm]
15+
distribution = true
16+
17+
[build-system]
18+
requires = ["pdm-backend"]
19+
build-backend = "pdm.backend"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[tool.poetry]
2+
name = "{{ project_name }}"
3+
version = "{{ package_version }}"
4+
description = "{{ package_description }}"
5+
authors = []
6+
readme = "README.md"
7+
packages = [
8+
{ include = "{{ package_name }}" },
9+
]
10+
include = ["CHANGELOG.md", "{{ package_name }}/py.typed"]
11+
12+
[tool.poetry.dependencies]
13+
python = "^3.9"
14+
httpx = ">=0.23.0,<0.29.0"
15+
attrs = ">=22.2.0"
16+
python-dateutil = "^2.8.0"
17+
18+
[build-system]
19+
requires = ["poetry-core>=1.0.0"]
20+
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)