Skip to content

Commit fa6c284

Browse files
ericmjlZeroto521
andauthored
[INF/DOC] Documentation bugfix by pinning mkdocstrings to 0.18.1 (#1147)
* HOTFIX documentation bugfix by pinning mkdocstrings to 0.18.1 * Add mkdocstrings-python-legacy into env * Apply to mkdocs/environment * Add first pass on automated test for docs build. * Commented out `mkdocs/environment.yaml` until further discussion. Co-authored-by: Zero <[email protected]>
1 parent 6c43b9d commit fa6c284

File tree

5 files changed

+57
-26
lines changed

5 files changed

+57
-26
lines changed

.github/workflows/docs-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
auto-update-conda: true
2424
miniforge-variant: Mambaforge
25-
environment-file: mkdocs/environment.yaml
25+
environment-file: environment-dev.yml
2626
use-mamba: true
2727

2828
- name: Build docs

environment-dev.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ dependencies:
2222
- make
2323
- mkdocs
2424
- mkdocs-material
25-
- mkdocstrings-python
25+
- mkdocstrings=0.18.1
26+
- mkdocstrings-python-legacy=0.2.2
2627
- missingno
2728
- multipledispatch
2829
- mypy

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ plugins:
4646
show_source: true
4747
# https://github.com/mkdocstrings/mkdocstrings/issues/278#issuecomment-831411193
4848
selection:
49-
docstring_style: sphinx
49+
docstring_style: restructured-text
5050
# custom_templates: templates
5151
watch:
5252
- janitor/

mkdocs/environment.yaml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
name: pyjanitor-doc
2-
channels:
3-
- conda-forge
4-
dependencies:
5-
- python
6-
# required
7-
- pandas
8-
- pandas-flavor
9-
- multipledispatch
10-
- scipy
11-
# optional
12-
- biopython
13-
- natsort
14-
- pyspark>=3.2.0
15-
- rdkit
16-
- tqdm
17-
- unyt
18-
- xarray
19-
- numba
20-
# doc
21-
- mkdocs
22-
- mkdocs-material
23-
- mkdocstrings-python
1+
# 14 August 2022: Temporarily commenting out.
2+
# See: https://github.com/pyjanitor-devs/pyjanitor/pull/1147#issuecomment-1214508157
3+
# for more context on why.
4+
# name: pyjanitor-doc
5+
# channels:
6+
# - conda-forge
7+
# dependencies:
8+
# - python
9+
# # required
10+
# - pandas
11+
# - pandas-flavor
12+
# - multipledispatch
13+
# - scipy
14+
# # optional
15+
# - biopython
16+
# - natsort
17+
# - pyspark>=3.2.0
18+
# - rdkit
19+
# - tqdm
20+
# - unyt
21+
# - xarray
22+
# - numba
23+
# # doc
24+
# - mkdocs
25+
# - mkdocs-material
26+
# # To fix #1146
27+
# # - mkdocstrings-python
28+
# - mkdocstrings=0.18.1
29+
# - mkdocstrings-python-legacy=0.2.2

tests/test_documentation_build.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""Tests for documentation build."""
2+
3+
import os
4+
5+
6+
def test_docs_general_functions_present():
7+
"""Test that all docs pages build correctly.
8+
9+
TODO: There has to be a better way to automatically check that
10+
all of the functions are present in the docs.
11+
This is an awesome thing that we could use help with in the future.
12+
"""
13+
# Build docs using mkdocs
14+
os.system("mkdocs build --clean")
15+
16+
# We want to check that the following keywords are all present.
17+
# I put in a subsample of general functions.
18+
# This can be made much more robust.
19+
rendered_correctly = False
20+
with open("./site/api/functions/index.html", "r+") as f:
21+
for line in f.readlines():
22+
if "add_columns" in line or "update_where" in line:
23+
rendered_correctly = True
24+
assert rendered_correctly

0 commit comments

Comments
 (0)