From 6a95d58c29d4c502206e37d87c73de8edd27cadd Mon Sep 17 00:00:00 2001 From: Xavier Bouthillier Date: Wed, 13 Sep 2017 22:30:37 -0400 Subject: [PATCH] Replace sphinx[...]-autoprogram by sphinx-argparse Why: sphinxcontrib-autoprogram's pip version does not support python 3. There is a more recent version in bitbucket's repository but the installation is tedious for the few features it gives. (See comment https://github.com/SMART-Lab/smartdispatch/pull/160#issuecomment-317028667 for more details on the problem) How: sphinxcrontrib-autoprogram was only used to generate automatic documentation of the script smart-dispatch so the replacement was trivial. The output is slightly different, arguments being included in tables for sphinx-argparse while not for sphinxcrontrib-autoprogram. Overall sphinx-argparse seems good enough. --- docs/source/conf.py | 5 +---- docs/source/usage.rst | 4 +++- setup.py | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index afd2228..5a7a168 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,7 +30,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.autoprogram'] +extensions = ['sphinx.ext.autodoc', 'sphinxarg.ext'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -151,6 +151,3 @@ author, 'SmartDispatch', 'One line description of project.', 'Miscellaneous'), ] - - - diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 698decc..984899f 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -2,7 +2,9 @@ Usage ===== -.. autoprogram:: scripts/smart-dispatch:get_parser() +.. argparse:: + :filename: ../../scripts/smart-dispatch + :func: get_parser :prog: smart-dispatch diff --git a/setup.py b/setup.py index cc69a84..3905056 100644 --- a/setup.py +++ b/setup.py @@ -12,11 +12,12 @@ 'scripts/sd-launch-pbs'], url='https://github.com/SMART-Lab/smartdispatch', license='LICENSE.txt', - description='An easy to use job launcher for supercomputers with PBS compatible job manager.', + description=('An easy to use job launcher for supercomputers with PBS ' + 'compatible job manager.'), long_description=open('README.md').read(), install_requires=['psutil>=1'], extras_require={ - 'doc': ['sphinxcontrib-autoprogram>=0.1.3'] + 'doc': ['sphinx-argparse>=0.2.1'] }, package_data={'smartdispatch': ['config/*.json']} )