From d47f9bde8ebf4113489c6fa518be1e003d0e9bd0 Mon Sep 17 00:00:00 2001 From: Cail Daley Date: Thu, 11 Jun 2026 03:19:24 +0200 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20fix=20PR/push=20triggers=20(master=20?= =?UTF-8?q?=E2=86=92=20develop/main)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both ci-build.yml (PR check) and cd-build.yml (coverage/docs deploy) targeted a 'master' branch that doesn't exist — the project uses develop as integration branch and main for releases. PRs to develop (e.g. #65) have been landing with zero CI. Retargeted both to develop + main to match the actual branch topology. Co-Authored-By: Claude on behalf of Cail --- .github/workflows/cd-build.yml | 3 ++- .github/workflows/ci-build.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-build.yml b/.github/workflows/cd-build.yml index a7a2152..4548440 100644 --- a/.github/workflows/cd-build.yml +++ b/.github/workflows/cd-build.yml @@ -3,7 +3,8 @@ name: CD on: push: branches: - - master + - develop + - main jobs: diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 20b2237..7617d94 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -3,7 +3,8 @@ name: CI on: pull_request: branches: - - master + - develop + - main jobs: build: From 63ce5cb552fbcca5ef1b4ccb941b21117b6146ac Mon Sep 17 00:00:00 2001 From: Cail Daley Date: Thu, 11 Jun 2026 03:34:00 +0200 Subject: [PATCH 2/2] ci: modernize CI/CD workflow bodies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI (ci-build.yml): checkout@v4 + setup-python@v5, pip install '.[test]', plain pytest on ubuntu/macos x py3.10/3.12; also runs on pushes to develop/main. Drops conda-era plumbing (poetry, 'setup.py test', the miniconda PATH export), the hard-deprecated upload/download-artifact@v2 pair, the EnricoMi test-results job (its artifact name never matched, so it has been broken since inception), the pinned-2020 wemake-styleguide action, and codecov (badge points at a stale personal fork; no codecov.yml; codecov-action@v1 is dead). CD (cd-build.yml): now purely the docs pipeline — sphinx-apidoc + sphinx-build on a plain pip install '.[docs]', built as a check on PRs (HTML uploaded as artifact for preview) and deployed to gh-pages on pushes to develop/main via actions-gh-pages@v4. Conda setup, the duplicate test/coverage job, and the twine sdist check (publish.yml owns packaging) are gone; pandoc is not needed (no notebook sources). Docs deps move from docs/requirements.txt (sphinx 3.3.1-era pins that no longer install on py>=3.10) to a 'docs' extra in pyproject.toml; conf.py gains py3-native importlib.metadata and an Author-email fallback (modern packaging leaves 'Author' unset). Docs build verified locally on 3.12. Co-Authored-By: Claude Fable 5 --- .github/workflows/cd-build.yml | 93 ++++++++++++---------------------- .github/workflows/ci-build.yml | 81 ++++++----------------------- docs/requirements.txt | 7 --- docs/source/conf.py | 4 +- pyproject.toml | 9 ++++ 5 files changed, 57 insertions(+), 137 deletions(-) delete mode 100644 docs/requirements.txt diff --git a/.github/workflows/cd-build.yml b/.github/workflows/cd-build.yml index 4548440..b2ea973 100644 --- a/.github/workflows/cd-build.yml +++ b/.github/workflows/cd-build.yml @@ -1,3 +1,7 @@ +# Build the Sphinx API documentation. +# +# pull_request → build only, as a check (no deploy) +# push: develop/main → build + deploy to GitHub Pages name: CD on: @@ -5,84 +9,49 @@ on: branches: - develop - main + pull_request: + branches: + - develop + - main + workflow_dispatch: jobs: - - coverage: - name: Deploy Coverage Results - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Conda with Python 3.8 - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: 3.8 - auto-activate-base: false - - - name: Install dependencies - shell: bash -l {0} - run: | - python -m pip install --upgrade pip - python -m pip install -r develop.txt - python -m pip install twine - python -m pip install . - - - name: Run Tests - shell: bash -l {0} - run: | - python setup.py test - - - name: Check distribution - shell: bash -l {0} - run: | - python setup.py sdist - twine check dist/* - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: coverage.xml - flags: unittests - - api: - name: Deploy API Documentation - needs: coverage + docs: + name: Build API Documentation runs-on: ubuntu-latest - if: success() + permissions: + contents: write steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Set up Conda with Python 3.8 - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Python + uses: actions/setup-python@v5 with: - auto-update-conda: true - python-version: 3.8 - auto-activate-base: false + python-version: "3.12" + cache: pip - - name: Install dependencies - shell: bash -l {0} - run: | - conda install -c conda-forge pandoc - python -m pip install --upgrade pip - python -m pip install -r docs/requirements.txt - python -m pip install . + - name: Install package with docs dependencies + run: python -m pip install ".[docs]" - name: Build API documentation - shell: bash -l {0} run: | sphinx-apidoc -t docs/_templates -feTMo docs/source cs_util sphinx-apidoc -t docs/_script_templates -feTMo docs/source scripts - sphinx-build -E docs/source docs/_build + sphinx-build -b html docs/source docs/_build + + # Upload the rendered HTML so it can be previewed from the run summary + # on pull requests, where the deploy is skipped. + - name: Upload built docs + uses: actions/upload-artifact@v4 + with: + name: docs-html + path: docs/_build - name: Deploy API documentation - uses: peaceiris/actions-gh-pages@v3.5.9 + if: github.event_name == 'push' + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/_build diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7617d94..43a0592 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,13 +1,18 @@ name: CI on: + push: + branches: + - develop + - main pull_request: branches: - develop - main + workflow_dispatch: jobs: - build: + test: name: Run Unit Tests runs-on: ${{ matrix.os }} @@ -15,76 +20,20 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.10.12] + python-version: ["3.10", "3.12"] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Report WPS Errors - uses: wemake-services/wemake-python-styleguide@0.14.1 - continue-on-error: true + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: - reporter: 'github-pr-review' - path: './cs_util' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Poetry - run: pip install poetry + python-version: ${{ matrix.python-version }} + cache: pip - - name: Install Dependencies - shell: bash -l {0} - run: poetry install - - - name: Build Package - run: poetry build + - name: Install package with test dependencies + run: python -m pip install ".[test]" - name: Run Tests - shell: bash -l {0} - run: | - export PATH=/usr/share/miniconda/bin:$PATH - python setup.py test - - - name: Save Test Results - if: always() - uses: actions/upload-artifact@v2 - with: - name: unit-test-results-${{ matrix.os }}-${{ matrix.python-version }} - path: pytest.xml - - - name: Check API Documentation build - shell: bash -l {0} - run: | - conda install -c conda-forge pandoc - sphinx-apidoc -t docs/_templates -feTMo docs/source cs_util - sphinx-apidoc -t docs/_script_templates -feTMo docs/source scripts - sphinx-build -b doctest -E docs/source docs/_build - - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: coverage.xml - flags: unittests - - test-results: - name: Deploy Test Results - needs: build - runs-on: ubuntu-latest - if: success() || failure() - - steps: - - name: Download Artifacts - uses: actions/download-artifact@v2 - with: - name: unit-test-results-ubuntu-latest-3.8 - path: artifacts - - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v1.5 - with: - check_name: Unit Test Report - github_token: ${{ secrets.GITHUB_TOKEN }} - report_individual_runs: true - files: artifacts/pytest.xml + run: pytest diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 0461d39..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -jupyter==1.0.0 -nbsphinx==0.8.0 -nbsphinx-link==1.3.0 -numpydoc==1.1.0 -sphinx==3.3.1 -sphinxcontrib-bibtex==1.0.0 -sphinxawesome-theme==1.17.0 diff --git a/docs/source/conf.py b/docs/source/conf.py index 1ed7905..ea15559 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -4,7 +4,7 @@ # Import relevant modules import sys import os -from importlib_metadata import metadata +from importlib.metadata import metadata # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -18,7 +18,7 @@ project = "cs_util" mdata = metadata(project) -author = mdata["Author"] +author = mdata["Author"] or mdata["Author-email"] version = mdata["Version"] copyright = "2022, {}".format(author) gh_user = "martinkilbinger" diff --git a/pyproject.toml b/pyproject.toml index ad014c6..38eeaa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,4 +40,13 @@ test = [ "pytest-pydocstyle", "pytest-cov", ] +docs = [ + "sphinx>=8.0", + "numpydoc>=1.8", + "sphinxcontrib-bibtex>=2.6", + # 6.0.3 is a broken wheel on PyPI (dist-info only, no python module) + "sphinxawesome-theme>=5.3,!=6.0.3", + "nbsphinx>=0.9", + "nbsphinx-link>=1.3", +]