From 91ba861fb2d0a2ee6a155a1728b66649b9bf3163 Mon Sep 17 00:00:00 2001 From: tristanlatr <19967168+tristanlatr@users.noreply.github.com> Date: Thu, 26 Jun 2025 13:04:40 -0400 Subject: [PATCH 1/3] Add docs step that generate the API documentation and publish it on gh-pages when a commit is pushed on the master branch --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4337cca..a38ca60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,36 @@ jobs: - uses: actions/checkout@v4 - uses: astral-sh/ruff-action@v3 - run: pipx run 'codespell[toml]' **/*.py **/*.txt --skip="venv/lib/python3*" - + + docs: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: 3.12 + - run: | + python -m pip install -U pip setuptools wheel + python -m pip install pydoctor + - run: | + # Do not consider exit code 2 as a real error + trap 'if [[ "$?" == "2" ]]; then exit 0; fi' EXIT + # Run pydoctor + pydoctor \ + --project-url=https://github.com/$GITHUB_REPOSITORY \ + --html-viewsource-base=https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_SHA \ + --html-base-url=https://$GITHUB_REPOSITORY_OWNER.github.io/${GITHUB_REPOSITORY#*/} \ + --html-output=./www \ + fluidsynth.py + - if: github.ref == 'refs/heads/master' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./www + commit_message: "Generate API documentation" + ci: needs: [codespell_and_ruff] strategy: From 95cd2ec8de70b6aa7934c3fa994238e15289f03d Mon Sep 17 00:00:00 2001 From: tristanlatr <19967168+tristanlatr@users.noreply.github.com> Date: Thu, 26 Jun 2025 13:08:14 -0400 Subject: [PATCH 2/3] Add intersphinx config --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 4076669..acd3b46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,3 +95,8 @@ lint.per-file-ignores."__init__.py" = [ "E402" ] lint.per-file-ignores."test/*" = [ "S101" ] lint.pylint.allow-magic-value-types = [ "int", "str" ] lint.pylint.max-args = 8 + +[tool.pydoctor] +intersphinx = ["https://docs.python.org/3/objects.inv"] +docformat = "restructuredtext" +verbose = 1 From 9828e0af15d8f469a63433c0e38d8fc694c58bf8 Mon Sep 17 00:00:00 2001 From: tristanlatr <19967168+tristanlatr@users.noreply.github.com> Date: Thu, 26 Jun 2025 13:11:43 -0400 Subject: [PATCH 3/3] Add names to important CI steps --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a38ca60..675e259 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,10 +23,12 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.12 - - run: | + - name: Install requirements + run: | python -m pip install -U pip setuptools wheel python -m pip install pydoctor - - run: | + - name: Run pydoctor + run: | # Do not consider exit code 2 as a real error trap 'if [[ "$?" == "2" ]]; then exit 0; fi' EXIT # Run pydoctor