Skip to content

Commit e7d0361

Browse files
authored
Merge pull request #233 from Project-MONAI/vikash/fixdocs
Fixed empty documentation on docs.monai
2 parents 0aa7ef0 + f339e86 commit e7d0361

File tree

7 files changed

+32
-54
lines changed

7 files changed

+32
-54
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
subprocess.call(
1818
"/bin/bash -c 'source /home/docs/checkouts/readthedocs.org/user_builds/"
19-
f"{READTHEDOCS_PROJECT}/envs/{READTHEDOCS_VERSION}/bin/activate; ../../run setup'",
19+
f"{READTHEDOCS_PROJECT}/envs/{READTHEDOCS_VERSION}/bin/activate; ../../run setup read_the_docs'",
2020
shell=True,
2121
)
2222
subprocess.call(

docs/source/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
introduction/index
88
getting_started/index
99
developing_with_sdk/index
10+
```
11+
12+
```{toctree}
13+
:glob:
14+
:maxdepth: 2
15+
1016
modules/index
1117
```

docs/source/modules/index.md

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,14 @@
11
# MODULES APIS
22

3-
## Core
4-
53
```{toctree}
6-
:maxdepth: 3
7-
:hidden:
4+
:glob:
5+
:maxdepth: 2
86
97
core
10-
```
11-
12-
## Domain objects
13-
14-
```{toctree}
15-
:maxdepth: 2
16-
:hidden:
178
domain_objects
18-
```
19-
20-
## Operators
21-
22-
```{toctree}
23-
:maxdepth: 2
24-
:hidden:
259
operators
26-
```
27-
28-
## Models
29-
30-
```{toctree}
31-
:maxdepth: 2
32-
:hidden:
3310
models
34-
```
35-
36-
## Graphs
37-
38-
```{toctree}
39-
:maxdepth: 2
40-
:hidden:
4111
graphs
42-
```
43-
44-
## Executors
45-
46-
```{toctree}
47-
:maxdepth: 2
48-
:hidden:
4912
executors
50-
```
51-
52-
## Datastores
53-
54-
```{toctree}
55-
:maxdepth: 2
56-
:hidden:
5713
datastores
5814
```

monai/deploy/cli/exec_command.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
def create_exec_parser(subparser: _SubParsersAction, command: str, parents: List[ArgumentParser]) -> ArgumentParser:
2525
# Intentionally use `argparse.HelpFormatter` instead of `argparse.ArgumentDefaultsHelpFormatter`.
2626
# Default values for those options are None and those would be filled by `RuntimeEnv` object later.
27-
parser = subparser.add_parser(command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False)
27+
parser: ArgumentParser = subparser.add_parser(
28+
command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False
29+
)
2830

2931
parser.add_argument("--input", "-i", help="Path to input folder/file (default: input)")
3032
parser.add_argument("--output", "-o", help="Path to output folder (default: output)")

monai/deploy/packager/package_command.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818

1919
def create_package_parser(subparser: _SubParsersAction, command: str, parents: List[ArgumentParser]) -> ArgumentParser:
20-
parser = subparser.add_parser(command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False)
20+
parser: ArgumentParser = subparser.add_parser(
21+
command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False
22+
)
2123

2224
parser.add_argument("application", type=str, help="MONAI application path")
2325
parser.add_argument(

monai/deploy/runner/run_command.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020

2121

2222
def create_run_parser(subparser: _SubParsersAction, command: str, parents: List[ArgumentParser]) -> ArgumentParser:
23-
parser = subparser.add_parser(command, formatter_class=HelpFormatter, parents=parents, add_help=False)
23+
parser: ArgumentParser = subparser.add_parser(
24+
command, formatter_class=HelpFormatter, parents=parents, add_help=False
25+
)
2426

2527
parser.add_argument("map", metavar="<map-image[:tag]>", help="MAP image name")
2628

run

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,16 @@ get_package_info() {
301301
#==================================================================================
302302

303303
install_python_dev_deps() {
304+
local config="${1:-dev}"
304305
if [ -n "${VIRTUAL_ENV}" ] || [ -n "${CONDA_PREFIX}" ]; then
305-
run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build
306+
# Read the Docs site is using specific setuptools version so should not upgrade it.
307+
if [ "$config" = "read_the_docs" ]; then
308+
run_command ${MONAI_PY_EXE} -m pip install -q -U pip wheel build
309+
else
310+
run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build
311+
fi
306312
run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/requirements-dev.txt
307313
run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/requirements-examples.txt
308-
309314
else
310315
c_echo_err R "You must be in a virtual environment to install dependencies."
311316
if [ ! -e "$TOP/.venv/dev/bin/python3" ]; then
@@ -370,10 +375,14 @@ install_edit_mode() {
370375
}
371376

372377
setup_desc() { c_echo 'Setup development environment
378+
379+
Arguements:
380+
$1 - configuration (default: "dev")
373381
'
374382
}
375383
setup() {
376-
install_python_dev_deps
384+
local config="${1:-dev}"
385+
install_python_dev_deps "${config}"
377386
}
378387

379388
clean_desc() { c_echo 'Clean up temporary files and uninstall monai-deploy-app-sdk
@@ -895,6 +904,7 @@ install_doc_requirements() {
895904
run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build
896905
run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/docs/requirements.txt
897906
install_edit_mode
907+
hash -r # reload hash for sphinx-build command
898908
else
899909
c_echo_err R "You must be in a virtual environment to install dependencies."
900910
if [ ! -e "$TOP/.venv/dev/bin/python3" ]; then
@@ -916,7 +926,7 @@ setup_gen_docs() {
916926
# Remove existing files in dist/docs
917927
run_command rm -rf ${output_folder}/*
918928
# Remove existing _autosummary folder
919-
run command rm -rf ${TOP}/docs/source/modules/_autosummary
929+
run_command rm -rf ${TOP}/docs/source/modules/_autosummary
920930

921931
# Symbolic link notebooks folder from 'docs/source/notebooks' to 'notebooks'
922932
run_command rm -rf ${TOP}/docs/source/notebooks

0 commit comments

Comments
 (0)