Skip to content

[Python] Remove nose support from server generators - #25402

Open
Bernardoow wants to merge 2 commits into
OpenAPITools:masterfrom
Bernardoow:remove-nose
Open

Bernardoow wants to merge 2 commits into
OpenAPITools:masterfrom
Bernardoow:remove-nose

Conversation

@Bernardoow

@Bernardoow Bernardoow commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

This MR removes nose support from the Flask, aiohttp, and BluePlanet server generators. It removes the useNose option and Java API, makes the generators use their existing pytest configuration, and updates related requirements, tox and Travis configurations, documentation, samples, and ignore files. It also fixes Flask Travis to install test requirements and run pytest.
The change preserves existing dependency versions and Python support settings. Users who set useNose should remove that property. Custom templates or generated projects with nose configuration may need manual updates.
Validation: the focused Java tests passed (35 tests). The full Maven suite passed except for a remote fixture test blocked by sandbox network access; it passed on a network-enabled rerun. Python sample results matched their baselines, including the same existing failures. BluePlanet’s runtime could not be validated because Python 3.5 and a pinned dependency were unavailable.

PR checklist

./mvnw clean package || exit
  ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
  ./bin/utils/export_docs_generators.sh || exit

(For Windows users, please run the script in WSL)
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.

  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 47 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/migration-guide.adoc">

<violation number="1" location="docs/migration-guide.adoc:14">
P3: This heading names no release, unlike every other section in the guide. Add the target version (for example, 'From 7.x.y to 7.z.0') so readers can tell which release removes `useNose`.</violation>
</file>

<file name="modules/openapi-generator/src/main/resources/python-flask/travis.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/python-flask/travis.mustache:20">
P1: This install line makes the Python 3.2–3.6 Flask Travis jobs install `pytest~=7.1.0`, which requires Python 3.7+. Those jobs now fail while resolving test dependencies; use Python-version-specific pytest constraints or remove the incompatible jobs.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

{{/useConnexion3}}
# command to install dependencies
install: "pip install -r requirements.txt"
install: "pip install -r requirements.txt -r test-requirements.txt"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: This install line makes the Python 3.2–3.6 Flask Travis jobs install pytest~=7.1.0, which requires Python 3.7+. Those jobs now fail while resolving test dependencies; use Python-version-specific pytest constraints or remove the incompatible jobs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At modules/openapi-generator/src/main/resources/python-flask/travis.mustache, line 20:

<comment>This install line makes the Python 3.2–3.6 Flask Travis jobs install `pytest~=7.1.0`, which requires Python 3.7+. Those jobs now fail while resolving test dependencies; use Python-version-specific pytest constraints or remove the incompatible jobs.</comment>

<file context>
@@ -17,6 +17,6 @@ python:
 {{/useConnexion3}}
 # command to install dependencies
-install: "pip install -r requirements.txt"
+install: "pip install -r requirements.txt -r test-requirements.txt"
 # command to run tests
-script: nosetests
</file context>

Comment thread docs/migration-guide.adoc
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28with%20fallback%29[Breaking change (with fallback)]
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28without%20fallback%29[Breaking change (without fallback)]

=== Removal of nose test-runner support

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: This heading names no release, unlike every other section in the guide. Add the target version (for example, 'From 7.x.y to 7.z.0') so readers can tell which release removes useNose.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/migration-guide.adoc, line 14:

<comment>This heading names no release, unlike every other section in the guide. Add the target version (for example, 'From 7.x.y to 7.z.0') so readers can tell which release removes `useNose`.</comment>

<file context>
@@ -11,6 +11,18 @@ Another approach to find breaking changes is to look at issue and pull requests
 * link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28with%20fallback%29[Breaking change (with fallback)]
 * link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28without%20fallback%29[Breaking change (without fallback)]
 
+=== Removal of nose test-runner support
+
+The `python-flask`, `python-aiohttp`, and `python-blueplanet` generators now always generate their existing pytest requirements and tox commands. The `useNose` option has been removed without a deprecation period or fallback. Existing pytest/plugin version constraints, Python settings, and generated test styles are preserved; this change does not standardize or upgrade the testing dependencies.
</file context>

@Bernardoow

Copy link
Copy Markdown
Contributor Author

Needs wait this PR #25376

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant