Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INF/DOC] Documentation bugfix by pinning mkdocstrings to 0.18.1 #1147

Merged
merged 5 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ dependencies:
- make
- mkdocs
- mkdocs-material
- mkdocstrings-python
- mkdocstrings=0.18.1
- mkdocstrings-python-legacy=0.2.2
- missingno
- multipledispatch
- mypy
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
52 changes: 29 additions & 23 deletions mkdocs/environment.yaml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions tests/test_documentation_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Tests for documentation build."""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zeroto521 and @samukweku this is the automated hack I have in place to check that our docs are built correctly automatically... at least for the general functions page. We may want to do a more comprehensive thing later.


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