[python] Validate pyproject.toml and fix the pyproject.toml version constraint format #353
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python Client (Echo API) | |
| on: | |
| pull_request: | |
| paths: | |
| - samples/client/echo_api/python/** | |
| - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/** | |
| - .github/workflows/samples-python-client-echo-api.yaml | |
| 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/client/echo_api/python/pyproject.toml | |
| build: | |
| name: Test Python client | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sample: | |
| # clients | |
| - samples/client/echo_api/python | |
| - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent | |
| python-version: | |
| - "3.9" | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup node.js | |
| uses: actions/setup-node@v4 | |
| - 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 unittest discover | |
| - name: mypy | |
| working-directory: ${{ matrix.sample }} | |
| run: python -m mypy |