Skip to content

Commit 64c8711

Browse files
authored
[python] Fix pyproject (poetry 2.x) for httpx (OpenAPITools#22289)
* fix poetry 2 httpx dependencies * use poetry 2 for tests
1 parent 65359d8 commit 64c8711

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

bin/configs/python-httpx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ library: httpx
66
additionalProperties:
77
packageName: petstore_api
88
mapNumberTo: float
9-
poetry1: true
9+
poetry1: false
1010
nameMappings:
1111
_type: underscore_type
1212
type_: type_with_underscore

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ requires-python = ">=3.9"
6161
dependencies = [
6262
"urllib3 (>=2.1.0,<3.0.0)",
6363
"python-dateutil (>=2.8.2)",
64-
{{#async}}
64+
{{#httpx}}
65+
"httpx (>=0.28.1)",
66+
{{/httpx}}
67+
{{#asyncio}}
6568
"aiohttp (>=3.8.4)",
6669
"aiohttp-retry (>=2.8.3)",
67-
{{/async}}
70+
{{/asyncio}}
6871
{{#tornado}}
6972
"tornado (>=4.2,<5)",
7073
{{/tornado}}

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

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
[tool.poetry]
1+
[project]
22
name = "petstore_api"
33
version = "1.0.0"
44
description = "OpenAPI Petstore"
5-
authors = ["OpenAPI Generator Community <[email protected]>"]
6-
license = "Apache-2.0"
5+
authors = [
6+
{name = "OpenAPI Generator Community",email = "[email protected]"},
7+
]
8+
license = { text = "Apache-2.0" }
79
readme = "README.md"
8-
repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
910
keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"]
10-
include = ["petstore_api/py.typed"]
11+
requires-python = ">=3.9"
12+
13+
dependencies = [
14+
"urllib3 (>=2.1.0,<3.0.0)",
15+
"python-dateutil (>=2.8.2)",
16+
"httpx (>=0.28.1)",
17+
"pem (>=19.3.0)",
18+
"pycryptodome (>=3.9.0)",
19+
"pydantic (>=2)",
20+
"typing-extensions (>=4.7.1)",
21+
]
22+
23+
[project.urls]
24+
Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
1125

12-
[tool.poetry.dependencies]
13-
python = "^3.9"
14-
urllib3 = ">= 2.1.0, < 3.0.0"
15-
python-dateutil = ">= 2.8.2"
16-
httpx = ">= 0.28.1"
17-
pem = ">= 19.3.0"
18-
pycryptodome = ">= 3.9.0"
19-
pydantic = ">= 2"
20-
typing-extensions = ">= 4.7.1"
26+
[tool.poetry]
27+
requires-poetry = ">=2.0"
2128

22-
[tool.poetry.dev-dependencies]
29+
[tool.poetry.group.dev.dependencies]
2330
pytest = ">= 7.2.1"
2431
pytest-cov = ">= 2.8.1"
2532
tox = ">= 3.9.0"

0 commit comments

Comments
 (0)