From cae694f52434e74386a9f1fd2007a218e3a3d670 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 15 Sep 2021 09:13:08 +0200 Subject: [PATCH] docs: furo theme (#64) * docs: furo theme * add schema check * drop CircleCI * sphinx==4.0 & nbsphinx==0.8.6 --- .github/workflows/ci_schema.yml | 20 +++++ .github/workflows/ci_testing.yml | 16 ++-- .github/workflows/docs-check.yml | 11 ++- circle.yml | 108 ------------------------- docs/requirements.txt | 7 +- docs/source/conf.py | 4 +- notebooks/ANHIR_evaluation-board.ipynb | 15 +--- 7 files changed, 46 insertions(+), 135 deletions(-) create mode 100644 .github/workflows/ci_schema.yml delete mode 100644 circle.yml diff --git a/.github/workflows/ci_schema.yml b/.github/workflows/ci_schema.yml new file mode 100644 index 00000000..8d7f24a2 --- /dev/null +++ b/.github/workflows/ci_schema.yml @@ -0,0 +1,20 @@ +name: CI action schema +on: # Trigger the workflow on push or pull request, but only for the master branch + push: {} + pull_request: + branches: [master] + +jobs: + validate-schema: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install pkg + run: | + pip install check-jsonschema + + - name: GH Workflows + run: | + check-jsonschema .github/workflows/*.yml --schemafile "https://json.schemastore.org/github-workflow" diff --git a/.github/workflows/ci_testing.yml b/.github/workflows/ci_testing.yml index 709b70a4..a0d83fcd 100644 --- a/.github/workflows/ci_testing.yml +++ b/.github/workflows/ci_testing.yml @@ -13,13 +13,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, windows-2019, macOS-10.15] - python-version: [2.7, 3.6, 3.8] - requires: ['minimal', 'latest'] - exclude: - - python-version: 2.7 - requires: 'minimal' - - python-version: 3.8 + os: [ubuntu-20.04, windows-2019, macOS-10.15] + python-version: [3.6, 3.9] + requires: ['latest'] + include: + - os: "ubuntu-18.04" + python-version: 2.7 + requires: 'latest' + - os: "ubuntu-18.04" + python-version: 3.6 requires: 'minimal' # Timeout: https://stackoverflow.com/a/59076067/4521646 diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index 478cdbdc..3bbad032 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -1,8 +1,11 @@ name: "Docs check" # https://github.com/marketplace/actions/sphinx-build -on: -- pull_request +# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows +on: # Trigger the workflow on push or pull request, but only for the master branch + push: + branches: [master] + pull_request: {} jobs: @@ -36,8 +39,8 @@ jobs: - name: Test Documentation run: | # First run the same pipeline as Read-The-Docs - cd docs make doctest + working-directory: ./docs make-docs: runs-on: ubuntu-20.04 @@ -70,10 +73,10 @@ jobs: - name: Make Documentation run: | - cd docs make clean make html --debug --jobs 2 SPHINXOPTS="-W" make latexpdf + working-directory: ./docs - name: Upload built docs uses: actions/upload-artifact@v2 diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 5d1e61ab..00000000 --- a/circle.yml +++ /dev/null @@ -1,108 +0,0 @@ -version: 2.0 - -references: - - install_deps: &install_deps - run: - name: Install Packages - command: | - sudo apt-get update -qq - # sudo apt-get install git-lfs - sudo apt-get install tk-dev pkg-config python-dev python-tk tree - sudo apt-get install openslide-tools - - install_pips: &install_pips - run: - name: Install PyPI dependences - command: | - py_ver=$(python -c"import sys; print(sys.version_info.major)") - if [ $py_ver -eq 2 ]; then - cp -r require-py27.txt requirements.txt ; - fi - pip install -U backports.functools_lru_cache # required for matplotlib @py2 - pip install "setuptools<46" -U # v46 crashes openslide-python install - pip install -r requirements.txt --user - python --version - pwd ; ls - pip --version - pip list - - test_coverage: &test_coverage - run: - name: Testing and coverage - command: | - unset DISPLAY - pip install -r ./tests/requirements.txt - mkdir test-reports && mkdir results - coverage run --source birl -m pytest birl tests bm_dataset bm_experiments bm_ANHIR -v --junitxml=test-reports/pytest_junit.xml - coverage report - codecov - rm -rf results - - make_docs: &make_docs - run: - name: Make Documentation - command: | - # sudo apt-get install pandoc - pyenv global 3.7.3 - python --version - pip install -r docs/requirements.txt - # sphinx-apidoc -o ./docs/source ./imsegm **/test_* --force --follow-links - cd docs - make html --debug --jobs 2 SPHINXOPTS="-W" - make latexpdf - - -jobs: - - Py3-Tests: - docker: - - image: circleci/python:3.6 - steps: &steps_tests - - checkout - # INSTALLATION - - *install_deps - #- run: git lfs pull - - *install_pips - # TESTING - - *test_coverage - - # PASSING - - run: - name: Finalise - command: | - python setup.py install --dry-run --user - coverage report && coverage xml -o test-reports/coverage.xml - # RESULTS - - store_test_results: - path: test-reports - - store_artifacts: - path: test-reports - - Py2-Tests: - docker: - - image: circleci/python:2.7 - steps: *steps_tests - - Build-Docs: - docker: - - image: readthedocs/build:latest - steps: - - checkout - # INSTALLATION - - *install_pips - # DOCUMENTATION - - *make_docs - # PREVIEW - - store_artifacts: - # allows us to preview the generated html pages - path: docs/build/html/ - destination: html - -workflows: - version: 2 - build: - jobs: - - Py2-Tests - - Py3-Tests - #- Build-Docs diff --git a/docs/requirements.txt b/docs/requirements.txt index 8ad3e3d1..f39a7319 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,8 +1,9 @@ -sphinx>=2.0, <3.0 +sphinx>=4.0, <4.1 # assert 'Verbatim' in lines[0] m2r # fails with multi-line text myst-parser -nbsphinx>=0.8.5 +nbsphinx==0.8.6 # freeze for some "Unexpected indentation" in notebooks pandoc -docutils<0.15 # higher version breaks py2 +docutils # >0.15 higher version breaks py2 imgconverter ipython +furo diff --git a/docs/source/conf.py b/docs/source/conf.py index 2e9d8eca..e44d0aee 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -75,7 +75,7 @@ # If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '2.2' +needs_sphinx = '4.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom @@ -143,7 +143,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # http://www.sphinx-doc.org/en/master/usage/theming.html#builtin-themes -html_theme = 'nature' +html_theme = "furo" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/notebooks/ANHIR_evaluation-board.ipynb b/notebooks/ANHIR_evaluation-board.ipynb index a99c2a57..e4ef996f 100644 --- a/notebooks/ANHIR_evaluation-board.ipynb +++ b/notebooks/ANHIR_evaluation-board.ipynb @@ -8,9 +8,11 @@ "source": [ "# ANHIR: Evaluation Board\n", "\n", - "This notebook serves as visualisation for challenge results in several forms - standard tables and charts. First, all submissions have to be recomputed, so they also contain the detail about each image registration pair. One of the perspective to validate is the difference between training and testing.\n", + "This notebook serves as visualisation for challenge results in several forms - standard tables and charts.\n", + "First, all submissions have to be recomputed, so they also contain the detail about each image registration pair.\n", + "One of the perspective to validate is the difference between training and testing.\n", "\n", - "The ANHIR challenge is hosted on https://anhir.grand-challenge.org.\n", + "**The ANHIR challenge is hosted on https://anhir.grand-challenge.org.**\n", "\n", "These particular results are for ANHIR workshop hosted at ISBI 2019 in Venice, Italy.\n", "In case you want to get some further evaluation related to new submission, you may contact one of the ANHIR administrators because the full submission is required, see https://anhir.grand-challenge.org/Organizers." @@ -3506,15 +3508,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9" - }, - "pycharm": { - "stem_cell": { - "cell_type": "raw", - "metadata": { - "collapsed": false - }, - "source": [] - } } }, "nbformat": 4,