From da58408c4f55f9b579856dd5063e40dac4eb7636 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 21 May 2022 16:13:31 +0200 Subject: [PATCH 1/7] ci: run MyST-NB with cache https://myst-nb.readthedocs.io/en/v0.15.0/computation/execute.html#notebook-execution-modes --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 754909bf..01cee258 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -323,7 +323,7 @@ def get_version(package_name: str) -> str: nb_execution_mode = "off" if "EXECUTE_NB" in os.environ: print("\033[93;1mWill run Jupyter notebooks!\033[0m") - nb_execution_mode = "force" + nb_execution_mode = "cache" # Settings for myst-parser myst_enable_extensions = [ From 09dc3abd92743d02e9b901b4bd204caa8e532d86 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 21 May 2022 16:13:36 +0200 Subject: [PATCH 2/7] ci: add jcache tox job --- tox.ini | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tox.ini b/tox.ini index c9b53d02..4e3b0b68 100644 --- a/tox.ini +++ b/tox.ini @@ -82,6 +82,15 @@ allowlist_externals = commands = make html +[testenv:jcache] +description = + Inspect Jupyter cache +allowlist_externals = + jcache +changedir = docs/_build +commands = + jcache {posargs:notebook list} + [testenv:linkcheck] description = Check external links in the documentation (requires internet connection) From f9576f93464c3934795815a3e96b768825168a44 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 21 May 2022 16:13:41 +0200 Subject: [PATCH 3/7] style: use 2 spaces indent size in ini files --- .editorconfig | 13 ++-- .pre-commit-config.yaml | 4 +- docs/_templates/module.rst_t | 4 +- docs/_templates/package.rst_t | 6 +- docs/_templates/toc.rst_t | 4 +- pytest.ini | 28 +++---- tox.ini | 140 +++++++++++++++++----------------- 7 files changed, 101 insertions(+), 98 deletions(-) diff --git a/.editorconfig b/.editorconfig index 2d5f62c9..12227023 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,6 +2,7 @@ root = true [*] end_of_line = lf +indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true @@ -9,15 +10,15 @@ trim_trailing_whitespace = true [Makefile] indent_style = tab +[*.ipynb] +indent_size = 1 + [*.{py,toml}] indent_size = 4 -[*.{json,yaml,yml}] -indent_size = 2 - -[*.{rst,inc}] -indent_size = 2 - # when adding words through vscode, this is the resulting output format [.cspell.json] indent_size = 4 + +[setup.cfg] +indent_size = 4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b21381b9..5dabf257 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -84,7 +84,9 @@ repos: - id: editorconfig-checker exclude: > (?x)^( - .*\.py + .*\.md| + .*\.py| + LICENSE )$ - repo: https://github.com/pycqa/isort diff --git a/docs/_templates/module.rst_t b/docs/_templates/module.rst_t index ac37fd52..6d477106 100644 --- a/docs/_templates/module.rst_t +++ b/docs/_templates/module.rst_t @@ -3,10 +3,10 @@ .. code-block:: python - import {{ basename }} + import {{ basename }} {% endif -%} .. automodule:: {{ qualname }} {%- for option in automodule_options %} - :{{ option }}: + :{{ option }}: {%- endfor %} diff --git a/docs/_templates/package.rst_t b/docs/_templates/package.rst_t index 97011393..cac2570e 100644 --- a/docs/_templates/package.rst_t +++ b/docs/_templates/package.rst_t @@ -1,14 +1,14 @@ {%- macro automodule(modname, options) -%} .. automodule:: {{ modname }} {%- for option in options %} - :{{ option }}: + :{{ option }}: {%- endfor %} {%- endmacro %} {%- macro toctree(docnames) -%} .. toctree:: {% for docname in docnames %} - {{ docname }} + {{ docname }} {%- endfor %} {%- endmacro %} @@ -16,7 +16,7 @@ .. code-block:: python - import {{ pkgname }} + import {{ pkgname }} {%- if modulefirst and not is_namespace %} {{ automodule(pkgname, automodule_options) }} diff --git a/docs/_templates/toc.rst_t b/docs/_templates/toc.rst_t index 878540ce..cba06b1a 100644 --- a/docs/_templates/toc.rst_t +++ b/docs/_templates/toc.rst_t @@ -1,7 +1,7 @@ {{ header | heading }} .. toctree:: - :maxdepth: {{ maxdepth }} + :maxdepth: {{ maxdepth }} {% for docname in docnames %} - {{ docname }} + {{ docname }} {%- endfor %} diff --git a/pytest.ini b/pytest.ini index e25c8809..8dd25843 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,21 +4,21 @@ source = src [pytest] addopts = - --color=yes - --doctest-continue-on-failure - --doctest-modules - --durations=3 - --ignore=docs/abbreviate_signature.py - --ignore=docs/conf.py + --color=yes + --doctest-continue-on-failure + --doctest-modules + --durations=3 + --ignore=docs/abbreviate_signature.py + --ignore=docs/conf.py filterwarnings = - error - ignore:Passing a schema to Validator.iter_errors is deprecated.*:DeprecationWarning - ignore:unclosed .*:ResourceWarning + error + ignore:Passing a schema to Validator.iter_errors is deprecated.*:DeprecationWarning + ignore:unclosed .*:ResourceWarning norecursedirs = - _build + _build markers = - slow: marks tests as slow (deselect with '-m "not slow"') + slow: marks tests as slow (deselect with '-m "not slow"') testpaths = - docs - src - tests + docs + src + tests diff --git a/tox.ini b/tox.ini index 4e3b0b68..48805aeb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = - py, - doc, - sty, + py, + doc, + sty, passenv = PYTHONPATH skip_install = True skip_missing_interpreters = True @@ -10,77 +10,77 @@ skipsdist = True [testenv] description = - Run all fast unit tests and doctests + Run all fast unit tests and doctests allowlist_externals = - pytest + pytest commands = - pytest src {posargs:tests/unit} + pytest src {posargs:tests/unit} [testenv:cov] description = - Compute the test coverage of all unit tests + Compute the test coverage of all unit tests allowlist_externals = - pytest + pytest commands = - pytest {posargs:tests/unit} \ - --cov-fail-under=90 \ - --cov-report=html \ - --cov-report=xml \ - --cov=qrules + pytest {posargs:tests/unit} \ + --cov-fail-under=90 \ + --cov-report=html \ + --cov-report=xml \ + --cov=qrules [testenv:doc] description = - Build documentation and API through Sphinx + Build documentation and API through Sphinx changedir = docs allowlist_externals = - make + make passenv = - READTHEDOCS_VERSION + READTHEDOCS_VERSION commands = - make html + make html [testenv:doclive] description = - Set up a server to directly preview changes to the HTML pages + Set up a server to directly preview changes to the HTML pages allowlist_externals = - sphinx-autobuild + sphinx-autobuild passenv = - EXECUTE_NB - READTHEDOCS_VERSION - TERM + EXECUTE_NB + READTHEDOCS_VERSION + TERM commands = - sphinx-autobuild \ - --watch docs \ - --watch src \ - --re-ignore .*/.ipynb_checkpoints/.* \ - --re-ignore .*/__pycache__/.* \ - --re-ignore .*\.tmp \ - --re-ignore docs/.*\.csv \ - --re-ignore docs/.*\.gv \ - --re-ignore docs/.*\.inv \ - --re-ignore docs/.*\.json \ - --re-ignore docs/.*\.pickle \ - --re-ignore docs/.*\.yaml \ - --re-ignore docs/.*\.yml \ - --re-ignore docs/_build/.* \ - --re-ignore docs/_images/.* \ - --re-ignore docs/_static/logo\..* \ - --re-ignore docs/api/.* \ - --open-browser \ - docs/ docs/_build/html + sphinx-autobuild \ + --open-browser \ + --re-ignore .*/.ipynb_checkpoints/.* \ + --re-ignore .*/__pycache__/.* \ + --re-ignore .*\.tmp \ + --re-ignore docs/.*\.csv \ + --re-ignore docs/.*\.gv \ + --re-ignore docs/.*\.inv \ + --re-ignore docs/.*\.json \ + --re-ignore docs/.*\.pickle \ + --re-ignore docs/.*\.yaml \ + --re-ignore docs/.*\.yml \ + --re-ignore docs/_build/.* \ + --re-ignore docs/_images/.* \ + --re-ignore docs/_static/logo\..* \ + --re-ignore docs/api/.* \ + --watch docs \ + --watch src \ + docs/ docs/_build/html [testenv:docnb] description = - Build documentation through Sphinx WITH output of Jupyter notebooks + Build documentation through Sphinx WITH output of Jupyter notebooks passenv = - READTHEDOCS_VERSION + READTHEDOCS_VERSION setenv = - EXECUTE_NB = "yes" + EXECUTE_NB = "yes" changedir = docs allowlist_externals = - make + make commands = - make html + make html [testenv:jcache] description = @@ -93,53 +93,53 @@ commands = [testenv:linkcheck] description = - Check external links in the documentation (requires internet connection) + Check external links in the documentation (requires internet connection) changedir = docs allowlist_externals = - make + make commands = - make ignore-warnings=1 linkcheck # for margin directive + make ignore-warnings=1 linkcheck # for margin directive [testenv:nb] description = - Run all notebooks with pytest + Run all notebooks with pytest allowlist_externals = - pytest + pytest commands = - pytest --nbmake {posargs:docs} + pytest --nbmake {posargs:docs} [testenv:pydeps] description = - Visualize module dependencies + Visualize module dependencies deps = - pydeps + pydeps changedir = src commands = - pydeps qrules \ - -o ../module_structure.svg \ - --exclude *._* \ - --max-bacon=1 \ - --noshow + pydeps qrules \ + -o ../module_structure.svg \ + --exclude *._* \ + --max-bacon=1 \ + --noshow passenv = HOME [testenv:sty] description = - Perform all linting, formatting, and spelling checks + Perform all linting, formatting, and spelling checks setenv = - SKIP = pyright + SKIP = pyright allowlist_externals = - pre-commit + pre-commit commands = - pre-commit run {posargs} -a + pre-commit run {posargs} -a [testenv:test] description = - Run ALL tests, including the slow channel tests, and compute coverage + Run ALL tests, including the slow channel tests, and compute coverage allowlist_externals = - pytest + pytest commands = - pytest {posargs} \ - --cov-fail-under=90 \ - --cov-report=html \ - --cov-report=xml \ - --cov=qrules + pytest {posargs} \ + --cov-fail-under=90 \ + --cov-report=html \ + --cov-report=xml \ + --cov=qrules From 538ef4133288bf4557c93d7023237f1b1a5e0f47 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 21 May 2022 16:13:44 +0200 Subject: [PATCH 4/7] chore: build documentation without make --- .cspell.json | 1 - .editorconfig | 3 --- .github/workflows/cd.yml | 2 +- .github/workflows/ci-docs.yml | 11 +++------ .github/workflows/ci-style.yml | 2 +- .github/workflows/ci-tests.yml | 2 +- .github/workflows/linkcheck.yml | 9 +++---- .github/workflows/requirements-cron.yml | 6 ++--- .github/workflows/requirements-pr.yml | 8 +++--- .pre-commit-config.yaml | 2 +- docs/Makefile | 25 ------------------- tox.ini | 33 ++++++++++++++++++------- 12 files changed, 42 insertions(+), 62 deletions(-) delete mode 100644 docs/Makefile diff --git a/.cspell.json b/.cspell.json index 6dc592fa..f2152a5e 100644 --- a/.cspell.json +++ b/.cspell.json @@ -44,7 +44,6 @@ "docs/adr/*/*", "docs/conf.py", "labels.toml", - "Makefile", "pyproject.toml", "pyrightconfig.json", "pytest.ini", diff --git a/.editorconfig b/.editorconfig index 12227023..c184b58e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,9 +7,6 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[Makefile] -indent_style = tab - [*.ipynb] indent_size = 1 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index afe566ac..e0e2e7a5 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -36,7 +36,7 @@ jobs: needs: push runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v2 with: diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 209dbdb4..72240b3a 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -18,7 +18,7 @@ jobs: name: Build documentation and run notebooks runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -26,14 +26,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -c .constraints/py3.8.txt .[doc] + pip install -c .constraints/py3.8.txt .[doc] tox sudo apt-get -y install graphviz pandoc - name: Build documentation and run notebooks - working-directory: docs - env: - EXECUTE_NB: YES - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: make html + run: tox -e docnb + # cspell:ignore docnb - name: Print error logs with color if: ${{ failure() }} # cspell:ignore printf diff --git a/.github/workflows/ci-style.yml b/.github/workflows/ci-style.yml index c699d800..3b204dd5 100644 --- a/.github/workflows/ci-style.yml +++ b/.github/workflows/ci-style.yml @@ -15,7 +15,7 @@ jobs: name: Style checks runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.8 uses: actions/setup-python@v2 with: diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index b3972c5e..77aaebac 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -69,7 +69,7 @@ jobs: - os: ubuntu-20.04 # coverage job python-version: "3.7" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 77271724..cc13f640 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -16,7 +16,7 @@ jobs: name: Check external links runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -24,15 +24,12 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -c .constraints/py3.8.txt -e .[doc] + pip install -c .constraints/py3.8.txt -e .[doc] tox sudo apt-get -y install graphviz pandoc - name: Check external links - working-directory: docs - env: - REPO: ${{ github.event.pull_request.head.repo.full_name }} run: | BRANCH=main if [[ "$GITHUB_HEAD_REF" != "" ]]; then BRANCH=$GITHUB_HEAD_REF fi - READTHEDOCS_VERSION=$BRANCH make ignore-warnings=1 linkcheck + READTHEDOCS_VERSION=$BRANCH tox -e linkcheck diff --git a/.github/workflows/requirements-cron.yml b/.github/workflows/requirements-cron.yml index da15ea90..0d0285c0 100644 --- a/.github/workflows/requirements-cron.yml +++ b/.github/workflows/requirements-cron.yml @@ -39,7 +39,7 @@ jobs: - "3.9" - "3.10" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ComPWA/update-pip-constraints@main with: python-version: ${{ matrix.python-version }} @@ -50,7 +50,7 @@ jobs: if: needs.is-even-week.outputs.is-even-week != 0 runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ComPWA/update-pre-commit@main push: @@ -60,7 +60,7 @@ jobs: - pip-constraints - pre-commit steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: token: ${{ secrets.PAT }} # GITHUB_TOKEN will not rerun checks after pushing to a PR branch diff --git a/.github/workflows/requirements-pr.yml b/.github/workflows/requirements-pr.yml index 83900bd3..4f9e4e6f 100644 --- a/.github/workflows/requirements-pr.yml +++ b/.github/workflows/requirements-pr.yml @@ -12,7 +12,7 @@ jobs: if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Determine dependency changes @@ -42,7 +42,7 @@ jobs: - "3.9" - "3.10" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ComPWA/update-pip-constraints@main with: python-version: ${{ matrix.python-version }} @@ -55,7 +55,7 @@ jobs: needs.diff.outputs.diff != '' runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ComPWA/update-pre-commit@main push: @@ -69,7 +69,7 @@ jobs: - pip-constraints - pre-commit steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: token: ${{ secrets.PAT }} # GITHUB_TOKEN will not rerun checks after pushing to a PR branch diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5dabf257..5be1e047 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.0.124 + rev: 0.0.125 hooks: - id: check-dev-files args: diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 5bd46973..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -T --color -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -ifdef ignore-warnings -else - SPHINXOPTS += -W --keep-going -endif - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/tox.ini b/tox.ini index 48805aeb..b2413323 100644 --- a/tox.ini +++ b/tox.ini @@ -31,13 +31,18 @@ commands = [testenv:doc] description = Build documentation and API through Sphinx -changedir = docs allowlist_externals = - make + sphinx-build passenv = + EXECUTE_NB READTHEDOCS_VERSION commands = - make html + sphinx-build \ + --color \ + --keep-going \ + -TW \ + -b html \ + docs/ docs/_build/html [testenv:doclive] description = @@ -76,11 +81,15 @@ passenv = READTHEDOCS_VERSION setenv = EXECUTE_NB = "yes" -changedir = docs allowlist_externals = - make + sphinx-build commands = - make html + sphinx-build \ + --color \ + --keep-going \ + -TW \ + -b html \ + docs/ docs/_build/html [testenv:jcache] description = @@ -94,11 +103,17 @@ commands = [testenv:linkcheck] description = Check external links in the documentation (requires internet connection) -changedir = docs +passenv = + EXECUTE_NB + READTHEDOCS_VERSION allowlist_externals = - make + sphinx-build commands = - make ignore-warnings=1 linkcheck # for margin directive + sphinx-build \ + --color \ + -T \ + -b linkcheck \ + docs/ docs/_build/linkcheck [testenv:nb] description = From b8d9b2a069f5b6a04468330af65e9992344d5cd9 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 21 May 2022 16:13:45 +0200 Subject: [PATCH 5/7] ci: define dependabot for GitHub Actions --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..a1322e2d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + assignees: + - redeboer + labels: + - 🖱️ DX + schedule: + interval: monthly From 7e0164dd9781ae19501c690d1f72f8b655c8f7ff Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 21 May 2022 16:39:56 +0200 Subject: [PATCH 6/7] fix: pass GITHUB_TOKEN to documentation building --- .github/workflows/ci-docs.yml | 2 ++ .github/workflows/linkcheck.yml | 2 ++ .pre-commit-config.yaml | 2 +- tox.ini | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 72240b3a..81ecca0a 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -29,6 +29,8 @@ jobs: pip install -c .constraints/py3.8.txt .[doc] tox sudo apt-get -y install graphviz pandoc - name: Build documentation and run notebooks + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: tox -e docnb # cspell:ignore docnb - name: Print error logs with color diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index cc13f640..c32a3928 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -27,6 +27,8 @@ jobs: pip install -c .constraints/py3.8.txt -e .[doc] tox sudo apt-get -y install graphviz pandoc - name: Check external links + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | BRANCH=main if [[ "$GITHUB_HEAD_REF" != "" ]]; then diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5be1e047..15006b04 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.0.125 + rev: 0.0.126 hooks: - id: check-dev-files args: diff --git a/tox.ini b/tox.ini index b2413323..37122403 100644 --- a/tox.ini +++ b/tox.ini @@ -35,6 +35,7 @@ allowlist_externals = sphinx-build passenv = EXECUTE_NB + GITHUB_TOKEN READTHEDOCS_VERSION commands = sphinx-build \ @@ -51,6 +52,7 @@ allowlist_externals = sphinx-autobuild passenv = EXECUTE_NB + GITHUB_TOKEN READTHEDOCS_VERSION TERM commands = @@ -78,6 +80,7 @@ commands = description = Build documentation through Sphinx WITH output of Jupyter notebooks passenv = + GITHUB_TOKEN READTHEDOCS_VERSION setenv = EXECUTE_NB = "yes" From 6d0b222e907d492e91c6a69906d4868e4c38c3d9 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 21 May 2022 16:54:17 +0200 Subject: [PATCH 7/7] ci: pass GITHUB_REPO environment variable --- .github/workflows/ci-docs.yml | 1 + .github/workflows/linkcheck.yml | 1 + .pre-commit-config.yaml | 2 +- tox.ini | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 81ecca0a..7de71b7a 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -30,6 +30,7 @@ jobs: sudo apt-get -y install graphviz pandoc - name: Build documentation and run notebooks env: + GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: tox -e docnb # cspell:ignore docnb diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index c32a3928..c78750a0 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -28,6 +28,7 @@ jobs: sudo apt-get -y install graphviz pandoc - name: Check external links env: + GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | BRANCH=main diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15006b04..ef0c6b0b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.0.126 + rev: 0.0.127 hooks: - id: check-dev-files args: diff --git a/tox.ini b/tox.ini index 37122403..60aea507 100644 --- a/tox.ini +++ b/tox.ini @@ -35,6 +35,7 @@ allowlist_externals = sphinx-build passenv = EXECUTE_NB + GITHUB_REPO GITHUB_TOKEN READTHEDOCS_VERSION commands = @@ -52,6 +53,7 @@ allowlist_externals = sphinx-autobuild passenv = EXECUTE_NB + GITHUB_REPO GITHUB_TOKEN READTHEDOCS_VERSION TERM @@ -80,6 +82,7 @@ commands = description = Build documentation through Sphinx WITH output of Jupyter notebooks passenv = + GITHUB_REPO GITHUB_TOKEN READTHEDOCS_VERSION setenv =