Skip to content

Conversation

@drewoldag
Copy link
Collaborator

The pre-commit hook and the Make file for building documentation were pushing output files to different locations. Specifically, the pre-commit hook was sending output files to ./docs/build/... while the make file was using ./docs/_build and ./_readthedocs.

The changes in this PR will bring the pre-commit hooks (w/ and w/o notebook rendering) into alignment with the sphinx Make file.

I've tested this locally by repeatedly running the following commands:
make html
and
pre-commit run --all-files sphinx-build
over two different hydrated projects.

The first was created with notebook rendering enabled, and the second was created without notebook rendering.

@drewoldag drewoldag self-assigned this Apr 18, 2023
@drewoldag drewoldag added bug Something isn't working documentation Improvements or additions to documentation labels Apr 18, 2023
@drewoldag drewoldag requested review from a team and cchris28 and removed request for a team April 18, 2023 17:57
Copy link
Collaborator

@cchris28 cchris28 left a comment

Choose a reason for hiding this comment

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

yay!

"./docs/build/doctrees", # Directory
"./docs/_build/doctrees", # Directory
"-D", # Flag to override settings in conf.py
"exclude_patterns=notebooks/*", # Exclude our notebooks from pre-commit
Copy link
Collaborator

Choose a reason for hiding this comment

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

this remains a difference. The pre-commit excludes notebooks while the sphinx builds include the notebooks.
I am only noting this since we really do not want the precommit to buid notebooks (dependency on pandocs).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct, and good observation. Additionally, building notebooks could take a long time if there is a significant amount of processing. It was a conscious decision to not build notebooks during the pre-commit step for these very reasons.

@drewoldag drewoldag merged commit 6144127 into main Apr 18, 2023
@drewoldag drewoldag deleted the issue/176/make-and-pre-commit-for-docs branch April 18, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure that pre-commit hook and make file for documentation produce identical output

3 participants