diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java index 5f29c5c909a..b2bb11e4f37 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java @@ -321,6 +321,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements supportingFiles.add(new SupportingFile("github-workflow.mustache", ".github/workflows", "python.yml")); supportingFiles.add(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml")); supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py")); + supportingFiles.add(new SupportingFile("pyproject.mustache", "", "pyproject.toml")); } supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py")); supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py")); diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache index ae4af162a14..201df14f1b4 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/README.mustache @@ -48,6 +48,10 @@ Then import the package: import {{{packageName}}} ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache new file mode 100644 index 00000000000..192ca581341 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-nextgen/pyproject.mustache @@ -0,0 +1,36 @@ +[tool.poetry] +name = "{{{packageName}}}" +version = "{{{packageVersion}}}" +description = "{{{appName}}}" +authors = ["{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}"] +license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}" +readme = "README.md" +repository = "https://github.com/{{{gitRepoId}}}/{{{gitUserId}}}" +keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +{{#asyncio}} +aiohttp = ">= 3.8.4" +{{/asyncio}} +{{#tornado}} +tornado = ">=4.2,<5" +{{/tornado}} +{{#hasHttpSignatureMethods}} +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +{{/hasHttpSignatureMethods}} +pydantic = ">= 1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=4.4.6" +flake8 = ">=6.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/samples/client/echo_api/python-nextgen/.openapi-generator/FILES b/samples/client/echo_api/python-nextgen/.openapi-generator/FILES index 134546f8564..82a301a4b1f 100644 --- a/samples/client/echo_api/python-nextgen/.openapi-generator/FILES +++ b/samples/client/echo_api/python-nextgen/.openapi-generator/FILES @@ -43,6 +43,7 @@ openapi_client/models/tag.py openapi_client/models/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.py openapi_client/models/test_query_style_form_explode_true_array_string_query_object_parameter.py openapi_client/rest.py +pyproject.toml requirements.txt setup.cfg setup.py diff --git a/samples/client/echo_api/python-nextgen/README.md b/samples/client/echo_api/python-nextgen/README.md index b945386e85c..0161a1364cd 100644 --- a/samples/client/echo_api/python-nextgen/README.md +++ b/samples/client/echo_api/python-nextgen/README.md @@ -40,6 +40,10 @@ Then import the package: import openapi_client ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: diff --git a/samples/client/echo_api/python-nextgen/pyproject.toml b/samples/client/echo_api/python-nextgen/pyproject.toml new file mode 100644 index 00000000000..a1ad217c190 --- /dev/null +++ b/samples/client/echo_api/python-nextgen/pyproject.toml @@ -0,0 +1,26 @@ +[tool.poetry] +name = "openapi_client" +version = "1.0.0" +description = "Echo Server API" +authors = ["team@openapitools.org"] +license = "Apache 2.0" +readme = "README.md" +repository = "https://github.com/GIT_REPO_ID/GIT_USER_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">= 1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=4.4.6" +flake8 = ">=6.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES index c2f43506f98..8e90f16b24f 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/.openapi-generator/FILES @@ -144,6 +144,7 @@ petstore_api/models/user.py petstore_api/models/with_nested_one_of.py petstore_api/rest.py petstore_api/signing.py +pyproject.toml requirements.txt setup.cfg setup.py diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md index d9db0c5fce3..2a6511e7b74 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md @@ -40,6 +40,10 @@ Then import the package: import petstore_api ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml new file mode 100644 index 00000000000..3c1002a8445 --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/pyproject.toml @@ -0,0 +1,29 @@ +[tool.poetry] +name = "petstore_api" +version = "1.0.0" +description = "OpenAPI Petstore" +authors = ["team@openapitools.org"] +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/GIT_REPO_ID/GIT_USER_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +aiohttp = ">= 3.8.4" +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +pydantic = ">= 1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=4.4.6" +flake8 = ">=6.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES index f5e76be9e49..0bd7787dea2 100755 --- a/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-nextgen/.openapi-generator/FILES @@ -144,6 +144,7 @@ petstore_api/models/user.py petstore_api/models/with_nested_one_of.py petstore_api/rest.py petstore_api/signing.py +pyproject.toml requirements.txt setup.cfg setup.py diff --git a/samples/openapi3/client/petstore/python-nextgen/README.md b/samples/openapi3/client/petstore/python-nextgen/README.md index 0f1d86506a4..00f4adf15c5 100755 --- a/samples/openapi3/client/petstore/python-nextgen/README.md +++ b/samples/openapi3/client/petstore/python-nextgen/README.md @@ -40,6 +40,10 @@ Then import the package: import petstore_api ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: diff --git a/samples/openapi3/client/petstore/python-nextgen/pyproject.toml b/samples/openapi3/client/petstore/python-nextgen/pyproject.toml new file mode 100644 index 00000000000..d70b472207c --- /dev/null +++ b/samples/openapi3/client/petstore/python-nextgen/pyproject.toml @@ -0,0 +1,28 @@ +[tool.poetry] +name = "petstore_api" +version = "1.0.0" +description = "OpenAPI Petstore" +authors = ["team@openapitools.org"] +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/GIT_REPO_ID/GIT_USER_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +pydantic = ">= 1.10.5" +aenum = ">=3.1.11" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=4.4.6" +flake8 = ">=6.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta"