Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bin/generate-samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then
# shellcheck disable=SC2068
java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]}
else
echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
#sleep 5
if [ ${#files[@]} -eq 0 ]; then
files=("${root}"/bin/configs/*.yaml)
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public PythonClientCodegen() {
cliOptions.clear();
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).")
.defaultValue("openapi_client"));
cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in setup.py (e.g. petstore-api)."));
cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in pyproject.toml (e.g. petstore-api)."));
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "python package version.")
.defaultValue("1.0.0"));
cliOptions.add(new CliOption(PACKAGE_URL, "python package URL."));
Expand Down Expand Up @@ -284,18 +284,17 @@ public void processOpts() {

if (!generateSourceCodeOnly) {
supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini"));
supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt"));
supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt"));
supportingFiles.add(new SupportingFile("setup_cfg.mustache", "", "setup.cfg"));

supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));
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("py.typed.mustache", packagePath(), "py.typed"));
} else {
supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt"));
supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt"));
}
supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py"));
supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,25 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
{{/hideGenerationTimestamp}}
- Generator version: {{generatorVersion}}
- Build package: {{generatorClass}}

{{#infoUrl}}
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}

## Requirements.
## Requirements

Python {{{generatorLanguageVersion}}}

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`)

Then import the package:
```python
import {{{packageName}}}
```

### Setuptools
Once installed, import the package:

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import {{{packageName}}}
```
Expand All @@ -58,4 +44,3 @@ Execute `pytest` to run the tests.
Please follow the [installation procedure](#installation--usage) and then run the following:

{{> common_README }}

Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,24 @@ The `{{packageName}}` package is automatically generated by the [OpenAPI Generat
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}

## Requirements.
## Requirements

Python {{{generatorLanguageVersion}}}

## Installation & Usage

This python library package is generated without supporting files like setup.py or requirements files

To be able to use it, you will need these dependencies in your own package that uses this library:

* urllib3 >= 2.1.0, < 3.0.0
* python-dateutil >= 2.8.2
{{#async}}
* aiohttp >= 3.8.4
* aiohttp-retry >= 2.8.3
{{/async}}
{{#tornado}}
* tornado >= 4.2, < 5
{{/tornado}}
{{#hasHttpSignatureMethods}}
* pem >= 19.3.0
* pycryptodome >= 3.9.0
{{/hasHttpSignatureMethods}}
* pydantic >= 2
* typing-extensions >= 4.7.1
This python library package is generated without supporting files like `pyproject.toml`.
To be able to use it, you will need these dependencies in your own package that uses this library.
Requirements files (`requirement.txt`, `test-requirements.txt`) are provided for this.
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Typo: requirement.txt should be requirements.txt (missing 's'). This inconsistency would confuse users trying to follow the installation instructions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache, line 27:

<comment>Typo: `requirement.txt` should be `requirements.txt` (missing 's'). This inconsistency would confuse users trying to follow the installation instructions.</comment>

<file context>
@@ -16,36 +16,24 @@ The `{{packageName}}` package is automatically generated by the [OpenAPI Generat
-* typing-extensions >= 4.7.1
+This python library package is generated without supporting files like `pyproject.toml`.
+To be able to use it, you will need these dependencies in your own package that uses this library.
+Requirements files (`requirement.txt`, `test-requirements.txt`) are provided for this.
+
+```
</file context>
Suggested change
Requirements files (`requirement.txt`, `test-requirements.txt`) are provided for this.
Requirements files (`requirements.txt`, `test-requirements.txt`) are provided for this.
Fix with Cubic


```
pip install -r requirements.txt # install runtime dependencies
pip install -r test-requirements.txt # (optional) install testing dependencies
```

## Getting Started

In your own code, to use this library to connect and interact with {{{projectName}}},
you can run the following:

{{> common_README }}

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

# flake8: noqa
{{>partial_header}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# coding: utf-8

# flake8: noqa

{{>partial_header}}


__version__ = "{{packageVersion}}"

# Define package exports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,65 +1,20 @@
{{#poetry1}}
[tool.poetry]
{{/poetry1}}
{{^poetry1}}
[build-system]
requires = ["poetry-core>=2.0.0"]
build-backend = "poetry.core.masonry.api"

[project]
{{/poetry1}}
name = "{{{packageName}}}"
version = "{{{packageVersion}}}"
description = "{{{appName}}}"
{{#poetry1}}
authors = ["{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}[email protected]{{/infoEmail}}>"]
{{/poetry1}}
{{^poetry1}}
authors = [
{name = "{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}}",email = "{{infoEmail}}{{^infoEmail}}[email protected]{{/infoEmail}}"},
{name = "{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}}", email = "{{infoEmail}}{{^infoEmail}}[email protected]{{/infoEmail}}"},
]
{{/poetry1}}
{{#licenseInfo}}
{{#poetry1}}
license = "{{{licenseInfo}}}"
{{/poetry1}}
{{^poetry1}}
license = { text = "{{{licenseInfo}}}" }
{{/poetry1}}
{{/licenseInfo}}
readme = "README.md"
{{#poetry1}}
repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}"
{{/poetry1}}
keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"]
{{#poetry1}}
include = ["{{packageName}}/py.typed"]

[tool.poetry.dependencies]
python = "^3.9"
{{^async}}
urllib3 = ">= 2.1.0, < 3.0.0"
{{/async}}
python-dateutil = ">= 2.8.2"
{{#asyncio}}
aiohttp = ">= 3.8.4"
aiohttp-retry = ">= 2.8.3"
{{/asyncio}}
{{#httpx}}
httpx = ">= 0.28.1"
{{/httpx}}
{{#tornado}}
tornado = ">=4.2, <5"
{{/tornado}}
{{#hasHttpSignatureMethods}}
pem = ">= 19.3.0"
pycryptodome = ">= 3.9.0"
{{/hasHttpSignatureMethods}}
pydantic = ">= 2"
typing-extensions = ">= 4.7.1"
{{#lazyImports}}
lazy-imports = ">= 1, < 2"
{{/lazyImports}}
{{/poetry1}}
{{^poetry1}}
requires-python = ">=3.9"

dependencies = [
{{^async}}
"urllib3 (>=2.1.0,<3.0.0)",
Expand Down Expand Up @@ -89,33 +44,19 @@ dependencies = [
[project.urls]
Repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}"

{{/poetry1}}
{{^poetry1}}
[tool.poetry]
requires-poetry = ">=2.0"
{{/poetry1}}

{{#poetry1}}
[tool.poetry.dev-dependencies]
{{/poetry1}}
{{^poetry1}}
[tool.poetry.group.dev.dependencies]
{{/poetry1}}
pytest = ">= 7.2.1"
pytest-cov = ">= 2.8.1"
tox = ">= 3.9.0"
flake8 = ">= 4.0.0"
ruff = ">= 0.14.0"
types-python-dateutil = ">= 2.8.19.14"
mypy = ">= 1.5"


[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.pylint.'MESSAGES CONTROL']
extension-pkg-whitelist = "pydantic"

[tool.ruff.lint]
select = ["E4", "E5", "E7", "E9", "F"]

[tool.mypy]
files = [
"{{{packageName}}}",
Expand Down
60 changes: 0 additions & 60 deletions modules/openapi-generator/src/main/resources/python/setup.mustache

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pytest >= 7.2.1
pytest-cov >= 2.8.1
tox >= 3.9.0
flake8 >= 4.0.0
ruff >= 0.14.0
types-python-dateutil >= 2.8.19.14
mypy >= 1.5
Loading