[python] Validate pyproject.toml and fix the pyproject.toml version constraint format (#21402)

* Validate pyproject.toml of echo client python sample

* Use PEP-508 compatible version constraint for `requires-python` key

* Update samples

* Move job to petstore workflow

* Update generated sample

* Use equals or greater than operator instead of greater than

* Update samples
This commit is contained in:
Youri Westerman 2025-06-18 10:39:37 +02:00 committed by GitHub
parent 50c6754fcc
commit 43e878b421
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 4 deletions

View File

@ -8,6 +8,18 @@ on:
- .github/workflows/samples-python-petstore.yaml - .github/workflows/samples-python-petstore.yaml
jobs: jobs:
validate-pyproject-toml:
name: Validate pyproject.toml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install validator
run: pip install 'validate-pyproject[all]'
- name: Validate
run: validate-pyproject samples/openapi3/client/petstore/python/pyproject.toml
build: build:
name: Test Python client name: Test Python client
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -43,7 +43,7 @@ pydantic = ">= 2"
typing-extensions = ">= 4.7.1" typing-extensions = ">= 4.7.1"
{{/poetry1}} {{/poetry1}}
{{^poetry1}} {{^poetry1}}
requires-python = "^3.9" requires-python = ">=3.9"
dependencies = [ dependencies = [
"urllib3 (>=2.1.0,<3.0.0)", "urllib3 (>=2.1.0,<3.0.0)",

View File

@ -8,7 +8,7 @@ authors = [
license = "Apache 2.0" license = "Apache 2.0"
readme = "README.md" readme = "README.md"
keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"] keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"]
requires-python = "^3.9" requires-python = ">=3.9"
dependencies = [ dependencies = [
"urllib3 (>=2.1.0,<3.0.0)", "urllib3 (>=2.1.0,<3.0.0)",

View File

@ -8,7 +8,7 @@ authors = [
license = "Apache 2.0" license = "Apache 2.0"
readme = "README.md" readme = "README.md"
keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"] keywords = ["OpenAPI", "OpenAPI-Generator", "Echo Server API"]
requires-python = "^3.9" requires-python = ">=3.9"
dependencies = [ dependencies = [
"urllib3 (>=2.1.0,<3.0.0)", "urllib3 (>=2.1.0,<3.0.0)",

View File

@ -8,7 +8,7 @@ authors = [
license = "Apache-2.0" license = "Apache-2.0"
readme = "README.md" readme = "README.md"
keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"] keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"]
requires-python = "^3.9" requires-python = ">=3.9"
dependencies = [ dependencies = [
"urllib3 (>=2.1.0,<3.0.0)", "urllib3 (>=2.1.0,<3.0.0)",