From 247ec72478dd635b7e9871da85a690f45f32fb04 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 21:05:57 +0000 Subject: [PATCH 1/2] Extend CI: lint, package build, docs build, PyPy, Windows/macOS - Run flake8 in a separate lint job: syntax errors and undefined names fail the build, everything else is reported as a warning. - Build sdist/wheel and run `twine check --strict` on every push/PR, not only at release time. - Build the Sphinx docs with warnings as errors. - Test on PyPy 3.10/3.11, matching the PyPy classifier. - Test on Windows and macOS (Python 3.13), matching "OS Independent". - Install test dependencies from requirements-dev.txt. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ASUFowntPRr2bsnKLwY3DB --- .github/workflows/test.yaml | 79 +++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 96abc3b..80bcbc6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,14 +5,77 @@ on: branches: [master] pull_request: {} +permissions: + contents: read + jobs: + lint: + name: "flake8 on code" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up Python 3.13 + uses: actions/setup-python@v7 + with: + python-version: "3.13" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + build: + name: "Build and check distributions" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up Python 3.13 + uses: actions/setup-python@v7 + with: + python-version: "3.13" + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install build twine + - name: Build sdist and wheel + run: python -m build + - name: Check distributions + run: twine check --strict dist/* + docs: + name: "Build documentation" runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up Python 3.13 + uses: actions/setup-python@v7 + with: + python-version: "3.13" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r doc/requirements.txt + - name: Build HTML docs + run: sphinx-build -W --keep-going -b html doc doc/_build/html + + test: + needs: [lint] + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + os: [ubuntu-latest] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.10", "pypy3.11"] + include: + - os: windows-latest + python-version: "3.13" + - os: macos-latest + python-version: "3.13" steps: - uses: actions/checkout@v7 @@ -23,15 +86,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest hypothesis - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install coverage -# - name: Lint with flake8 -# run: | - # stop the build if there are Python syntax errors or undefined names - # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + pip install -r requirements.txt -r requirements-dev.txt - name: Test run: | coverage run tests.py @@ -46,11 +101,11 @@ jobs: uses: coverallsapp/github-action@v2 with: file: coverage.lcov - flag-name: python-${{ matrix.python-version }} + flag-name: ${{ matrix.os }}-python-${{ matrix.python-version }} parallel: true coverage: - needs: build + needs: test if: ${{ always() }} runs-on: ubuntu-latest steps: From 7e62149481a94da543faf4299bdbd0ff7a2f79e5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 21:10:06 +0000 Subject: [PATCH 2/2] CI: drop PyPy 3.10, which can't install hypothesis Current hypothesis releases build a PyO3 extension, and PyO3 requires PyPy >= 3.11, so installing the test dependencies fails on PyPy 3.10. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ASUFowntPRr2bsnKLwY3DB --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 80bcbc6..e9ad37e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -70,7 +70,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.10", "pypy3.11"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.11"] include: - os: windows-latest python-version: "3.13"