-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fixing up readthedocs -- still in progress. #35
Changes from all commits
fa228da
27cba9b
adf93b0
e39b934
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||||||||||||||||||||
import os | ||||||||||||||||||||||
import shutil | ||||||||||||||||||||||
import sys | ||||||||||||||||||||||
|
||||||||||||||||||||||
# Configuration file for the Sphinx documentation builder. | ||||||||||||||||||||||
|
@@ -10,15 +11,24 @@ | |||||||||||||||||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||||||||||||||||||||||
|
||||||||||||||||||||||
project = "MEDS-Tab" | ||||||||||||||||||||||
copyright = "2024, Matthew McDermott, Nassim Oufattole, Teya Bergamaschi" | ||||||||||||||||||||||
author = "Matthew McDermott, Nassim Oufattole, Teya Bergamaschi" | ||||||||||||||||||||||
release = "0.0.1" | ||||||||||||||||||||||
version = "0.0.1" | ||||||||||||||||||||||
copyright = "2024, Nassim Oufattole, Matthew McDermott, Teya Bergamaschi, Aleksia Kolo, Hyewon Jeong" | ||||||||||||||||||||||
author = "Nassim Oufattole, Matthew McDermott, Teya Bergamaschi, Aleksia Kolo, Hyewon Jeong" | ||||||||||||||||||||||
release = "0.0.2" | ||||||||||||||||||||||
version = "0.0.2" | ||||||||||||||||||||||
|
||||||||||||||||||||||
# -- General configuration --------------------------------------------------- | ||||||||||||||||||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||||||||||||||||||||||
|
||||||||||||||||||||||
sys.path.insert(0, os.path.abspath("../..")) | ||||||||||||||||||||||
# -- Path setup | ||||||||||||||||||||||
from pathlib import Path | ||||||||||||||||||||||
|
||||||||||||||||||||||
__location__ = Path(os.path.dirname(__file__)) | ||||||||||||||||||||||
__src__ = __location__ / "../.." | ||||||||||||||||||||||
|
||||||||||||||||||||||
# If extensions (or modules to document with autodoc) are in another directory, | ||||||||||||||||||||||
# add these directories to sys.path here. If the directory is relative to the | ||||||||||||||||||||||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||||||||||||||||||||||
sys.path.insert(0, str(__src__)) | ||||||||||||||||||||||
|
||||||||||||||||||||||
extensions = [ | ||||||||||||||||||||||
"sphinx.ext.duration", | ||||||||||||||||||||||
|
@@ -38,6 +48,24 @@ | |||||||||||||||||||||
".md": "markdown", | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
# -- Run sphinx-apidoc | ||||||||||||||||||||||
# This ensures we don't need to run apidoc manually. | ||||||||||||||||||||||
|
||||||||||||||||||||||
# TODO: use https://github.com/sphinx-extensions2/sphinx-autodoc2 | ||||||||||||||||||||||
|
||||||||||||||||||||||
from sphinx.ext import apidoc | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the - from sphinx.ext import apidoc
+ import os
+ import sys
+ from sphinx.ext import apidoc
ToolsRuff
|
||||||||||||||||||||||
|
||||||||||||||||||||||
output_dir = __location__ / "generated" | ||||||||||||||||||||||
module_dir = __src__ / "src/MEDS_tabular_automl" | ||||||||||||||||||||||
if output_dir.is_dir(): | ||||||||||||||||||||||
shutil.rmtree(output_dir) | ||||||||||||||||||||||
|
||||||||||||||||||||||
try: | ||||||||||||||||||||||
cmd_line = f"--implicit-namespaces -e -f -o {output_dir} {module_dir}" | ||||||||||||||||||||||
apidoc.main(cmd_line.split(" ")) | ||||||||||||||||||||||
except Exception as e: # pylint: disable=broad-except | ||||||||||||||||||||||
print(f"Running `sphinx-apidoc {cmd_line}` failed!\n{e}") | ||||||||||||||||||||||
Comment on lines
+63
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider refining the exception handling to catch more specific exceptions rather than a broad catch. This will help in diagnosing specific issues more effectively. - except Exception as e: # pylint: disable=broad-except
+ except (IOError, OSError) as e: Committable suggestion
Suggested change
|
||||||||||||||||||||||
|
||||||||||||||||||||||
intersphinx_mapping = { | ||||||||||||||||||||||
"python": ("https://docs.python.org/3/", None), | ||||||||||||||||||||||
"sphinx": ("https://www.sphinx-doc.org/en/master/", None), | ||||||||||||||||||||||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving the
Path
import to the top to adhere to PEP 8 guidelines.Tools
Ruff