diff --git a/docs/source/conf.py b/docs/source/conf.py index 1c6e2587..77191b41 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,7 @@ subprocess.call( "/bin/bash -c 'source /home/docs/checkouts/readthedocs.org/user_builds/" - f"{READTHEDOCS_PROJECT}/envs/{READTHEDOCS_VERSION}/bin/activate; ../../run setup'", + f"{READTHEDOCS_PROJECT}/envs/{READTHEDOCS_VERSION}/bin/activate; ../../run setup read_the_docs'", shell=True, ) subprocess.call( diff --git a/docs/source/index.md b/docs/source/index.md index 6ccf0a08..2cbc7ec5 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -7,5 +7,11 @@ introduction/index getting_started/index developing_with_sdk/index +``` + +```{toctree} +:glob: +:maxdepth: 2 + modules/index ``` diff --git a/docs/source/modules/index.md b/docs/source/modules/index.md index d0cdec00..dc02aa9a 100644 --- a/docs/source/modules/index.md +++ b/docs/source/modules/index.md @@ -1,58 +1,14 @@ # MODULES APIS -## Core - ```{toctree} -:maxdepth: 3 -:hidden: +:glob: +:maxdepth: 2 core -``` - -## Domain objects - -```{toctree} -:maxdepth: 2 -:hidden: domain_objects -``` - -## Operators - -```{toctree} -:maxdepth: 2 -:hidden: operators -``` - -## Models - -```{toctree} -:maxdepth: 2 -:hidden: models -``` - -## Graphs - -```{toctree} -:maxdepth: 2 -:hidden: graphs -``` - -## Executors - -```{toctree} -:maxdepth: 2 -:hidden: executors -``` - -## Datastores - -```{toctree} -:maxdepth: 2 -:hidden: datastores ``` diff --git a/monai/deploy/cli/exec_command.py b/monai/deploy/cli/exec_command.py index 7be80baf..769d7518 100644 --- a/monai/deploy/cli/exec_command.py +++ b/monai/deploy/cli/exec_command.py @@ -24,7 +24,9 @@ def create_exec_parser(subparser: _SubParsersAction, command: str, parents: List[ArgumentParser]) -> ArgumentParser: # Intentionally use `argparse.HelpFormatter` instead of `argparse.ArgumentDefaultsHelpFormatter`. # Default values for those options are None and those would be filled by `RuntimeEnv` object later. - parser = subparser.add_parser(command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False) + parser: ArgumentParser = subparser.add_parser( + command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False + ) parser.add_argument("--input", "-i", help="Path to input folder/file (default: input)") parser.add_argument("--output", "-o", help="Path to output folder (default: output)") diff --git a/monai/deploy/packager/package_command.py b/monai/deploy/packager/package_command.py index 1d800956..39ce5088 100644 --- a/monai/deploy/packager/package_command.py +++ b/monai/deploy/packager/package_command.py @@ -17,7 +17,9 @@ def create_package_parser(subparser: _SubParsersAction, command: str, parents: List[ArgumentParser]) -> ArgumentParser: - parser = subparser.add_parser(command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False) + parser: ArgumentParser = subparser.add_parser( + command, formatter_class=argparse.HelpFormatter, parents=parents, add_help=False + ) parser.add_argument("application", type=str, help="MONAI application path") parser.add_argument( diff --git a/monai/deploy/runner/run_command.py b/monai/deploy/runner/run_command.py index a8e0ac4f..f492c903 100644 --- a/monai/deploy/runner/run_command.py +++ b/monai/deploy/runner/run_command.py @@ -20,7 +20,9 @@ def create_run_parser(subparser: _SubParsersAction, command: str, parents: List[ArgumentParser]) -> ArgumentParser: - parser = subparser.add_parser(command, formatter_class=HelpFormatter, parents=parents, add_help=False) + parser: ArgumentParser = subparser.add_parser( + command, formatter_class=HelpFormatter, parents=parents, add_help=False + ) parser.add_argument("map", metavar="", help="MAP image name") diff --git a/run b/run index 7ddc5d67..86cb3355 100755 --- a/run +++ b/run @@ -301,11 +301,16 @@ get_package_info() { #================================================================================== install_python_dev_deps() { + local config="${1:-dev}" if [ -n "${VIRTUAL_ENV}" ] || [ -n "${CONDA_PREFIX}" ]; then - run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build + # Read the Docs site is using specific setuptools version so should not upgrade it. + if [ "$config" = "read_the_docs" ]; then + run_command ${MONAI_PY_EXE} -m pip install -q -U pip wheel build + else + run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build + fi run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/requirements-dev.txt run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/requirements-examples.txt - else c_echo_err R "You must be in a virtual environment to install dependencies." if [ ! -e "$TOP/.venv/dev/bin/python3" ]; then @@ -370,10 +375,14 @@ install_edit_mode() { } setup_desc() { c_echo 'Setup development environment + +Arguements: + $1 - configuration (default: "dev") ' } setup() { - install_python_dev_deps + local config="${1:-dev}" + install_python_dev_deps "${config}" } clean_desc() { c_echo 'Clean up temporary files and uninstall monai-deploy-app-sdk @@ -895,6 +904,7 @@ install_doc_requirements() { run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/docs/requirements.txt install_edit_mode + hash -r # reload hash for sphinx-build command else c_echo_err R "You must be in a virtual environment to install dependencies." if [ ! -e "$TOP/.venv/dev/bin/python3" ]; then @@ -916,7 +926,7 @@ setup_gen_docs() { # Remove existing files in dist/docs run_command rm -rf ${output_folder}/* # Remove existing _autosummary folder - run command rm -rf ${TOP}/docs/source/modules/_autosummary + run_command rm -rf ${TOP}/docs/source/modules/_autosummary # Symbolic link notebooks folder from 'docs/source/notebooks' to 'notebooks' run_command rm -rf ${TOP}/docs/source/notebooks