Skip to content

Commit 155b166

Browse files
committed
[python] Switch build backend to poetry-core
This is more efficient and allows for seamless use of the package in e.g. tox Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent ab9c462 commit 155b166

3 files changed

Lines changed: 12 additions & 27 deletions

File tree

modules/openapi-generator/src/main/resources/python/pyproject.mustache

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["poetry-core>=2.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
15
[project]
26
name = "{{{packageName}}}"
37
version = "{{{packageVersion}}}"
@@ -11,7 +15,6 @@ license = { text = "{{{licenseInfo}}}" }
1115
readme = "README.md"
1216
keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"]
1317
requires-python = ">=3.9"
14-
1518
dependencies = [
1619
{{^async}}
1720
"urllib3 (>=2.1.0,<3.0.0)",
@@ -41,9 +44,6 @@ dependencies = [
4144
[project.urls]
4245
Repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}"
4346
44-
[tool.poetry]
45-
requires-poetry = ">=2.0"
46-
4747
[tool.poetry.group.dev.dependencies]
4848
pytest = ">= 7.2.1"
4949
pytest-cov = ">= 2.8.1"
@@ -52,11 +52,6 @@ flake8 = ">= 4.0.0"
5252
types-python-dateutil = ">= 2.8.19.14"
5353
mypy = ">= 1.5"
5454

55-
56-
[build-system]
57-
requires = ["setuptools"]
58-
build-backend = "setuptools.build_meta"
59-
6055
[tool.pylint.'MESSAGES CONTROL']
6156
extension-pkg-whitelist = "pydantic"
6257

samples/client/echo_api/python/pyproject.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["poetry-core>=2.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
15
[project]
26
name = "openapi_client"
37
version = "1.0.0"
@@ -9,7 +13,6 @@ license = { text = "Apache 2.0" }
913
readme = "README.md"
1014
keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"]
1115
requires-python = ">=3.9"
12-
1316
dependencies = [
1417
"urllib3 (>=2.1.0,<3.0.0)",
1518
"python-dateutil (>=2.8.2)",
@@ -20,9 +23,6 @@ dependencies = [
2023
[project.urls]
2124
Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
2225

23-
[tool.poetry]
24-
requires-poetry = ">=2.0"
25-
2626
[tool.poetry.group.dev.dependencies]
2727
pytest = ">= 7.2.1"
2828
pytest-cov = ">= 2.8.1"
@@ -31,11 +31,6 @@ flake8 = ">= 4.0.0"
3131
types-python-dateutil = ">= 2.8.19.14"
3232
mypy = ">= 1.5"
3333

34-
35-
[build-system]
36-
requires = ["setuptools"]
37-
build-backend = "setuptools.build_meta"
38-
3934
[tool.pylint.'MESSAGES CONTROL']
4035
extension-pkg-whitelist = "pydantic"
4136

samples/openapi3/client/petstore/python/pyproject.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["poetry-core>=2.0.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
15
[project]
26
name = "petstore_api"
37
version = "1.0.0"
@@ -9,7 +13,6 @@ license = { text = "Apache-2.0" }
913
readme = "README.md"
1014
keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"]
1115
requires-python = ">=3.9"
12-
1316
dependencies = [
1417
"urllib3 (>=2.1.0,<3.0.0)",
1518
"python-dateutil (>=2.8.2)",
@@ -22,9 +25,6 @@ dependencies = [
2225
[project.urls]
2326
Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
2427

25-
[tool.poetry]
26-
requires-poetry = ">=2.0"
27-
2828
[tool.poetry.group.dev.dependencies]
2929
pytest = ">= 7.2.1"
3030
pytest-cov = ">= 2.8.1"
@@ -33,11 +33,6 @@ flake8 = ">= 4.0.0"
3333
types-python-dateutil = ">= 2.8.19.14"
3434
mypy = ">= 1.5"
3535

36-
37-
[build-system]
38-
requires = ["setuptools"]
39-
build-backend = "setuptools.build_meta"
40-
4136
[tool.pylint.'MESSAGES CONTROL']
4237
extension-pkg-whitelist = "pydantic"
4338

0 commit comments

Comments
 (0)