diff --git a/.github/workflows/doc-requirements.txt b/.github/workflows/doc-requirements.txt new file mode 100644 index 000000000..3eee61b9f --- /dev/null +++ b/.github/workflows/doc-requirements.txt @@ -0,0 +1,3 @@ +enthought-sphinx-theme +sphinx +sphinx-copybutton diff --git a/.github/workflows/test-doc-build.yml b/.github/workflows/test-doc-build.yml new file mode 100644 index 000000000..da2303cee --- /dev/null +++ b/.github/workflows/test-doc-build.yml @@ -0,0 +1,26 @@ +name: Test the documentation build + +on: [pull_request, workflow_dispatch] + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' + cache-dependency-path: '.github/workflows/doc-requirements.txt' + - run: python -m pip install -r .github/workflows/doc-requirements.txt + - run: python -m pip install . + - run: | + python -m sphinx.ext.apidoc --separate --no-toc -o docs/source/api -t docs/source/api/templates envisage */tests + python -m sphinx -b html -d docs/build/doctrees docs/source docs/build/html + - uses: actions/upload-artifact@v3 + with: + name: documentation + path: | + docs/build/ + !docs/build/doctrees/ diff --git a/docs/source/conf.py b/docs/source/conf.py index 6e50918af..049e75e70 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,7 +18,8 @@ # All configuration values have a default value; values that are commented out # serve to show the default value. -import envisage +import importlib.metadata + import enthought_sphinx_theme # If your extensions are in another directory, add it here. If the directory @@ -57,7 +58,7 @@ # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. -version = release = envisage.__version__ +version = release = importlib.metadata.version("envisage") # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: