diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 590451750..ffe374d12 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -22,7 +22,7 @@ jobs: with: auto-update-conda: true miniforge-variant: Mambaforge - environment-file: mkdocs/environment.yaml + environment-file: environment-dev.yml use-mamba: true - name: Build docs diff --git a/environment-dev.yml b/environment-dev.yml index b2ff0c6f8..4f26797fb 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -22,7 +22,8 @@ dependencies: - make - mkdocs - mkdocs-material - - mkdocstrings-python + - mkdocstrings=0.18.1 + - mkdocstrings-python-legacy=0.2.2 - missingno - multipledispatch - mypy diff --git a/mkdocs.yml b/mkdocs.yml index 7d0c2dc63..3c95832c1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -46,7 +46,7 @@ plugins: show_source: true # https://github.com/mkdocstrings/mkdocstrings/issues/278#issuecomment-831411193 selection: - docstring_style: sphinx + docstring_style: restructured-text # custom_templates: templates watch: - janitor/ diff --git a/mkdocs/environment.yaml b/mkdocs/environment.yaml index 376256700..954cbbb7a 100644 --- a/mkdocs/environment.yaml +++ b/mkdocs/environment.yaml @@ -1,23 +1,29 @@ -name: pyjanitor-doc -channels: - - conda-forge -dependencies: - - python - # required - - pandas - - pandas-flavor - - multipledispatch - - scipy - # optional - - biopython - - natsort - - pyspark>=3.2.0 - - rdkit - - tqdm - - unyt - - xarray - - numba - # doc - - mkdocs - - mkdocs-material - - mkdocstrings-python +# 14 August 2022: Temporarily commenting out. +# See: https://github.com/pyjanitor-devs/pyjanitor/pull/1147#issuecomment-1214508157 +# for more context on why. +# name: pyjanitor-doc +# channels: +# - conda-forge +# dependencies: +# - python +# # required +# - pandas +# - pandas-flavor +# - multipledispatch +# - scipy +# # optional +# - biopython +# - natsort +# - pyspark>=3.2.0 +# - rdkit +# - tqdm +# - unyt +# - xarray +# - numba +# # doc +# - mkdocs +# - mkdocs-material +# # To fix #1146 +# # - mkdocstrings-python +# - mkdocstrings=0.18.1 +# - mkdocstrings-python-legacy=0.2.2 diff --git a/tests/test_documentation_build.py b/tests/test_documentation_build.py new file mode 100644 index 000000000..174c47777 --- /dev/null +++ b/tests/test_documentation_build.py @@ -0,0 +1,24 @@ +"""Tests for documentation build.""" + +import os + + +def test_docs_general_functions_present(): + """Test that all docs pages build correctly. + + TODO: There has to be a better way to automatically check that + all of the functions are present in the docs. + This is an awesome thing that we could use help with in the future. + """ + # Build docs using mkdocs + os.system("mkdocs build --clean") + + # We want to check that the following keywords are all present. + # I put in a subsample of general functions. + # This can be made much more robust. + rendered_correctly = False + with open("./site/api/functions/index.html", "r+") as f: + for line in f.readlines(): + if "add_columns" in line or "update_where" in line: + rendered_correctly = True + assert rendered_correctly