fix: restore Python 3.6 CLI and runtime compatibility #35
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: publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| repository: | |
| description: Publish target repository | |
| required: true | |
| default: testpypi | |
| type: choice | |
| options: | |
| - testpypi | |
| - pypi | |
| release: | |
| types: [published] | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| pytest-modern: | |
| name: pytest (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - "3.7" | |
| - "3.8" | |
| - "3.10" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Sync dependencies | |
| run: uv sync --dev | |
| - name: Run pytest | |
| run: uv run pytest | |
| pytest-py36: | |
| name: pytest (Python 3.6) | |
| runs-on: ubuntu-22.04 | |
| container: | |
| image: python:3.6.15-slim-bullseye | |
| steps: | |
| - name: Install system dependencies | |
| run: | | |
| printf '%s\n' \ | |
| 'deb [check-valid-until=no] https://archive.debian.org/debian bullseye main' \ | |
| > /etc/apt/sources.list | |
| apt-get -o APT::Update::Error-Mode=any update | |
| apt-get install -y --no-install-recommends git nodejs npm | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Mark workspace as safe for git | |
| run: git config --global --add safe.directory "$PWD" | |
| - name: Show runtime versions | |
| run: | | |
| python --version | |
| pip --version | |
| git --version | |
| node --version | |
| - name: Install Python 3.6 compatibility dependencies | |
| run: | | |
| python -m pip install -i https://pypi.org/simple \ | |
| "dataclasses>=0.8" \ | |
| "typing_extensions>=4.1.1,<4.2" \ | |
| "importlib_metadata>=4.8.3,<5" \ | |
| "tomli>=1.2.3,<2" \ | |
| "requests>=2.27.1" \ | |
| "prompt-toolkit>=3.0.36,<3.1" \ | |
| "pyyaml>=6.0" \ | |
| "loguru>=0.7.3,<1" \ | |
| "pycryptodomex>=3.20" \ | |
| "pillow>=8.4.0,<9" \ | |
| "fastapi>=0.83,<0.84" \ | |
| "uvicorn>=0.16,<0.17" \ | |
| "pytest>=6.2.5,<7" \ | |
| "pytest-asyncio>=0.16,<0.17" | |
| - name: Run Python 3.6 pytest | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| run: python -m pytest -c /dev/null | |
| build: | |
| needs: | |
| - pytest-modern | |
| - pytest-py36 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build distributions | |
| run: | | |
| python -m pip install --upgrade build twine | |
| python -m build --outdir dist/python-codex . | |
| python -m build --outdir dist/pycodex-ws packages/pycodex-ws | |
| python -m twine check dist/python-codex/* dist/pycodex-ws/* | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-testpypi: | |
| if: github.event_name == 'workflow_dispatch' && inputs.repository == 'testpypi' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/project/python-codex/ | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/python-codex/ | |
| repository-url: https://test.pypi.org/legacy/ | |
| publish-pypi: | |
| if: github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.repository == 'pypi') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/python-codex/ | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/python-codex/ | |
| publish-pycodex-ws: | |
| if: github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.repository == 'pypi') | |
| needs: | |
| - build | |
| - publish-pypi | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/pycodex-ws/ | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish pycodex-ws to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/pycodex-ws/ |