chore: Add sample flask app showing how to use the SDK #2
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-server-sdk | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint + Typecheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: uv sync | |
| run: uv sync --all-extras --frozen | |
| - name: ruff check | |
| run: uv run ruff check . | |
| - name: ruff format --check | |
| run: uv run ruff format --check . | |
| - name: mypy | |
| run: uv run mypy | |
| test: | |
| name: Test (Python ${{ matrix.python-version }} on ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| include: | |
| - os: macos-latest | |
| python-version: "3.13" | |
| - os: windows-latest | |
| python-version: "3.13" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: uv sync | |
| run: uv sync --all-extras --frozen | |
| - name: pytest | |
| run: uv run pytest --cov --cov-report=term-missing | |
| build: | |
| name: Build distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: uv build | |
| run: uv build | |
| - name: Check distribution metadata | |
| run: uvx twine check dist/* | |
| - name: Verify the wheel imports cleanly | |
| run: | | |
| uv venv /tmp/smoke | |
| VIRTUAL_ENV=/tmp/smoke uv pip install dist/*.whl | |
| /tmp/smoke/bin/python -c "import configdirector; print(configdirector.__version__)" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| samples: | |
| name: Sample apps | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sample: [flask] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| # Samples resolve the SDK from a local path, so they are not locked against a release. | |
| - name: uv sync | |
| run: uv sync | |
| working-directory: ./samples/${{ matrix.sample }} | |
| - name: mypy | |
| run: uv run mypy | |
| working-directory: ./samples/${{ matrix.sample }} | |
| - name: pytest | |
| run: uv run pytest | |
| working-directory: ./samples/${{ matrix.sample }} |