Skip to content

Add support to python 3.15 - #25304

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
Bernardoow:add-support-to-python3.15
Oct 19, 2026
Merged

wing328 merged 4 commits into
OpenAPITools:masterfrom
Bernardoow:add-support-to-python3.15

Conversation

@Bernardoow

@Bernardoow Bernardoow commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds support for Python 3.15 to the Python generators.

Python 3.15 was officially released on October 9, 2026.

Changes

Added Python 3.15 as a supported version.

Updated the Python generator configuration and documentation.

Updated the relevant generated samples.

Related issue

Closes #25303

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./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.

Summary by cubic

Adds Python 3.15 support to the Python generator CI templates and regenerated sample clients, and fixes a pycryptodome breaking change in the HTTP signature tests. Closes #25303.

  • Enables 3.15 in GitHub Actions, GitLab CI, and Travis configurations; the pydantic v1 workflows list it as commented-out for now.
  • Trims trailing whitespace in the "Install" step name in two sample workflows.
  • Updates test_http_signature.py to use pycryptodome's current key export API and accept either of the two encrypted-key error messages.

Written for commit 41991c6. Summary will update on new commits.

View guided diff

@Bernardoow

Copy link
Copy Markdown
Contributor Author

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

@cbornet (2017/09) @tomplus (2018/10) @krjakbrjak (2023/02) @fa0311 (2023/10)

@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.

1 issue found across 38 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=".github/workflows/samples-python-pydantic-v1-petstore.yaml">

<violation number="1" location=".github/workflows/samples-python-pydantic-v1-petstore.yaml:23">
P1: This enables Python 3.15 for the Pydantic v1 Petstore samples, but Pydantic v1 does not support Python 3.14 or newer. The new matrix jobs will fail; keep 3.15 commented out like the Pydantic v1 Echo workflow.</violation>
</file>

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

- "3.12"
- "3.13"
- "3.14"
- "3.15"

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 enables Python 3.15 for the Pydantic v1 Petstore samples, but Pydantic v1 does not support Python 3.14 or newer. The new matrix jobs will fail; keep 3.15 commented out like the Pydantic v1 Echo workflow.

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 .github/workflows/samples-python-pydantic-v1-petstore.yaml, line 23:

<comment>This enables Python 3.15 for the Pydantic v1 Petstore samples, but Pydantic v1 does not support Python 3.14 or newer. The new matrix jobs will fail; keep 3.15 commented out like the Pydantic v1 Echo workflow.</comment>

<file context>
@@ -20,6 +20,7 @@ jobs:
           - "3.12"
           - "3.13"
           - "3.14"
+          - "3.15"
         sample:
           - samples/openapi3/client/petstore/python-pydantic-v1-aiohttp
</file context>
Suggested change
- "3.15"
#- "3.15"

if not os.path.exists(cls.rsa4096_key_path):
key = RSA.generate(4096)
private_key = key.export_key(
format='PEM',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This failure comes from a PyCryptodome dependency update exposing an existing issue in the test setup.

The test passes protection='PEM' to RSA.export_key(). According to the export_key() documentation, PEM is an output format, while protection specifies the encryption scheme.

Previously, RSA export defaulted to PKCS#1, where protection was silently ignored. PyCryptodome 4.0 changed the default to PKCS#8 when a passphrase is supplied. As a result, PEM is now interpreted as an encryption scheme, causing ValueError: Unknown protection PEM.

This change is documented under 4.0.0 → Breaking changes, in the item beginning with “Exporting a private key with a passphrase”: [PyCryptodome changelog](https://www.pycryptodome.org/src/changelog).

The dependency constraint, pycryptodome >= 3.9.0, allows the new major version. The failure also occurs on Python 3.10, independently of the Python 3.15 addition.

The fix uses format='PEM' and explicitly sets pkcs=1 to preserve the key format expected by the signing code. All six HTTP signature tests pass with both PyCryptodome 3.24.1 and 4.0.1.

@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.

All reported issues were addressed across 2 files (changes from recent commits).

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

View guided diff | Re-trigger cubic

Comment thread samples/openapi3/client/petstore/python/tests/test_http_signature.py Outdated
@Bernardoow Bernardoow mentioned this pull request Oct 19, 2026
3 tasks done

@fa0311 fa0311 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.

LGTM

@wing328
wing328 merged commit bc98ebe into OpenAPITools:master Oct 19, 2026
92 checks passed
@wing328 wing328 added this to the 7.27.0 milestone Oct 19, 2026
@Bernardoow
Bernardoow deleted the add-support-to-python3.15 branch October 19, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] Add support for Python 3.15

3 participants