openapi-generator/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml
Jonathan Ballet 04fa53b692
python: generate Pydantic v2 + typing complete code (#16624)
* python: improve type generation with more specific typing

* Annotate function parameters

* Remove unused imports

* remove unused files

* remove temporary hack

* remove lock file

* fix Annotated import

* support Python 3.7

* Regenerate code with typing-extensions

* Fix setup.py

* More Pydantic v2 compatibility

* depend on pydantic v2

* fix client_echo tests

* fix JSON serialization

* Fix references

* Skip circular dependency tests for now

* Temporarily hide the "float" property

The "float" property aliases the "float" type and completely breaks the
model: all the properties that were "float" now become the type of the
"float" property instead.

* Fix errors

* Import Literal from typing_extensions

* Fix GitHub Action workflows

* Fix Python 3.7 failure

* Fix quotes

* Apply suggestions from code review

* Fix tests

* split model imports from other modules imports

* fix workflow

* Comment the array unique items convertion, remove set translation

* Replace alias usage
2023-09-28 19:13:14 +08:00

45 lines
1.2 KiB
YAML

name: Python Client pydantic v1 (Echo API)
on:
pull_request:
paths:
- samples/client/echo_api/python-pydantic-v1/**
- .github/workflows/samples-python-pydantic-v1-client-echo-api.yaml
jobs:
build:
name: Test Python client
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
# clients
- samples/client/echo_api/python-pydantic-v1/
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup node.js
uses: actions/setup-node@v3
- name: Run echo server
run: |
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server
(cd http-echo-server && npm install && npm start &)
- name: Install
working-directory: ${{ matrix.sample }}
run: |
pip install -r requirements.txt
pip install -r test-requirements.txt
- name: Test
working-directory: ${{ matrix.sample }}
run: python -m pytest