From 401256a6e546ad4e96c17c2f70ad5e3dba43c47c Mon Sep 17 00:00:00 2001 From: Dao Cong Tien Date: Thu, 12 Jul 2018 20:11:52 +0700 Subject: [PATCH] Adds doc8 check to pep8 This patch adds doc8 check for .rst files to pep8. Files that fail doc8 check are also fixed. Ignores D000, D001 of doc8 check. This requires lot of changes and should be done in a separated patch. Change-Id: I7d021e6fee3e12feff7c219e09c545da5274c354 --- doc/source/admin/agent-scheduler-install.rst | 16 ++++----- doc/source/admin/complete-install.rst | 2 +- doc/source/admin/freezer-web-ui-install.rst | 2 +- doc/source/admin/index.rst | 3 +- doc/source/admin/installation.rst | 14 ++++---- doc/source/admin/operation.rst | 2 +- doc/source/contributor/jobs.rst | 2 +- doc/source/install/get_started.rst | 2 +- doc/source/user/freezer-scheduler.rst | 2 +- doc/source/user/freezer-web-ui.rst | 2 +- doc/source/user/index.rst | 3 +- doc/source/user/installation.rst | 38 ++++++++++---------- lower-constraints.txt | 1 + specs/tenant_based_backups.rst | 2 +- test-requirements.txt | 4 +++ tox.ini | 8 ++++- 16 files changed, 56 insertions(+), 47 deletions(-) diff --git a/doc/source/admin/agent-scheduler-install.rst b/doc/source/admin/agent-scheduler-install.rst index 1357061f..dada3b56 100644 --- a/doc/source/admin/agent-scheduler-install.rst +++ b/doc/source/admin/agent-scheduler-install.rst @@ -41,24 +41,24 @@ Install required packages first: .. code:: bash - sudo apt-get install python-dev python-pip git openssl gcc make automake + sudo apt-get install python-dev python-pip git openssl gcc make automake Clone proper branch of Freezer Client with git: .. code:: bash - git clone -b [branch] https://github.com/openstack/freezer.git - + git clone -b [branch] https://github.com/openstack/freezer.git + Install requirements with pip: .. code:: bash - cd freezer/ - - sudo pip install -r requirements.txt - + cd freezer/ + + sudo pip install -r requirements.txt + Install freezer from source: .. code:: bash - sudo python setup.py install + sudo python setup.py install diff --git a/doc/source/admin/complete-install.rst b/doc/source/admin/complete-install.rst index 7372e3de..27020e94 100644 --- a/doc/source/admin/complete-install.rst +++ b/doc/source/admin/complete-install.rst @@ -8,4 +8,4 @@ Requirements ------------ Ubuntu / Debian Installation ----------------------------- \ No newline at end of file +---------------------------- diff --git a/doc/source/admin/freezer-web-ui-install.rst b/doc/source/admin/freezer-web-ui-install.rst index 7372e3de..27020e94 100644 --- a/doc/source/admin/freezer-web-ui-install.rst +++ b/doc/source/admin/freezer-web-ui-install.rst @@ -8,4 +8,4 @@ Requirements ------------ Ubuntu / Debian Installation ----------------------------- \ No newline at end of file +---------------------------- diff --git a/doc/source/admin/index.rst b/doc/source/admin/index.rst index 0370d23e..f1dd95d9 100644 --- a/doc/source/admin/index.rst +++ b/doc/source/admin/index.rst @@ -5,7 +5,6 @@ Table of Contents: .. toctree:: :maxdepth: 2 - + installation operation - \ No newline at end of file diff --git a/doc/source/admin/installation.rst b/doc/source/admin/installation.rst index 7b3ac652..69c0fd85 100644 --- a/doc/source/admin/installation.rst +++ b/doc/source/admin/installation.rst @@ -7,7 +7,7 @@ Agent & Scheduler Installation: .. toctree:: :maxdepth: 2 - + agent-scheduler-install Freezer API Installation @@ -15,21 +15,21 @@ Freezer API Installation .. toctree:: :maxdepth: 2 - + freezer-api-install - + Web UI Installation ------------------- .. toctree:: :maxdepth: 2 - + freezer-web-ui-install - + Backup as a Service Platform Installation ----------------------------------------- .. toctree:: :maxdepth: 2 - - complete-install \ No newline at end of file + + complete-install diff --git a/doc/source/admin/operation.rst b/doc/source/admin/operation.rst index 1e815fc7..8c4a18bf 100644 --- a/doc/source/admin/operation.rst +++ b/doc/source/admin/operation.rst @@ -1,4 +1,4 @@ Operation ========= -Here goes operation guides... \ No newline at end of file +Here goes operation guides... diff --git a/doc/source/contributor/jobs.rst b/doc/source/contributor/jobs.rst index a8279782..2171605d 100644 --- a/doc/source/contributor/jobs.rst +++ b/doc/source/contributor/jobs.rst @@ -27,7 +27,7 @@ Scheduling information enables future/recurrent execution of jobs job document structure -.. code-block:: none +.. code-block:: none "job": { "job_action": { parameters for freezer to execute a specific action } diff --git a/doc/source/install/get_started.rst b/doc/source/install/get_started.rst index f8f742f4..ea11f943 100644 --- a/doc/source/install/get_started.rst +++ b/doc/source/install/get_started.rst @@ -43,4 +43,4 @@ Concepts and definitions *hostname* is _probably_ going to be the host fqdn. -*backup_id* defined as UUID of a backup. \ No newline at end of file +*backup_id* defined as UUID of a backup. diff --git a/doc/source/user/freezer-scheduler.rst b/doc/source/user/freezer-scheduler.rst index 0b78b346..e3bb6caa 100644 --- a/doc/source/user/freezer-scheduler.rst +++ b/doc/source/user/freezer-scheduler.rst @@ -1,4 +1,4 @@ Scheduler User Guide ==================== -Here goes the guide... \ No newline at end of file +Here goes the guide... diff --git a/doc/source/user/freezer-web-ui.rst b/doc/source/user/freezer-web-ui.rst index ed568bdb..63002ffa 100644 --- a/doc/source/user/freezer-web-ui.rst +++ b/doc/source/user/freezer-web-ui.rst @@ -1,4 +1,4 @@ Web User Interface User Guide ============================= -Here goes the guide... \ No newline at end of file +Here goes the guide... diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst index 113bfc15..fde5e431 100644 --- a/doc/source/user/index.rst +++ b/doc/source/user/index.rst @@ -3,9 +3,8 @@ User Guide .. toctree:: :maxdepth: 2 - + installation freezer-agent freezer-scheduler freezer-web-ui - \ No newline at end of file diff --git a/doc/source/user/installation.rst b/doc/source/user/installation.rst index 87450ee3..951b0edd 100644 --- a/doc/source/user/installation.rst +++ b/doc/source/user/installation.rst @@ -38,33 +38,33 @@ Install required packages first: .. code:: bash - sudo apt-get install python-dev python-pip git openssl gcc make automake + sudo apt-get install python-dev python-pip git openssl gcc make automake For python3: .. code:: bash - sudo apt-get install python3-dev git openssl openssl-devel gcc make automake + sudo apt-get install python3-dev git openssl openssl-devel gcc make automake Clone proper branch of Freezer Client with git: .. code:: bash - git clone -b [branch] https://github.com/openstack/freezer.git + git clone -b [branch] https://github.com/openstack/freezer.git Install requirements with pip: .. code:: bash - cd freezer/ + cd freezer/ - sudo pip install -r requirements.txt + sudo pip install -r requirements.txt Install freezer from source: .. code:: bash - sudo python setup.py install + sudo python setup.py install Create ENV file: @@ -115,35 +115,35 @@ Install required packages first: .. code:: bash - sudo yum install python-devel python-pip git openssl \ - openssl-devel gcc make automake + sudo yum install python-devel python-pip git openssl \ + openssl-devel gcc make automake For python3: .. code:: bash - sudo apt-get install python3-devel git openssl \ - openssl-devel gcc make automake + sudo apt-get install python3-devel git openssl \ + openssl-devel gcc make automake Clone proper branch of Freezer Client with git: .. code:: bash - git clone -b [branch] https://github.com/openstack/freezer.git + git clone -b [branch] https://github.com/openstack/freezer.git Install requirements with pip: .. code:: bash - cd freezer/ + cd freezer/ - sudo pip install -r requirements.txt + sudo pip install -r requirements.txt Install freezer from source: .. code:: bash - sudo python setup.py install + sudo python setup.py install Create ENV file: @@ -214,8 +214,8 @@ After you have installed required packages install pip: .. code:: bash - easy_install -U pip - pip install freezer + easy_install -U pip + pip install freezer Freezer scheduler on windows run as a windows service and it needs to be installed as a user service: @@ -223,11 +223,11 @@ Freezer scheduler on windows run as a windows service and it needs to be install .. code:: bash - whoami + whoami - cd C:\Python27\Lib\site-packages\freezer\scheduler + cd C:\Python27\Lib\site-packages\freezer\scheduler - python win_service.py --username {whoami} --password {pc-password} install + python win_service.py --username {whoami} --password {pc-password} install Unofficial Installer for Windows -------------------------------- diff --git a/lower-constraints.txt b/lower-constraints.txt index 699c2f60..3ce6cc83 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -17,6 +17,7 @@ ddt==1.0.1 debtcollector==1.19.0 decorator==4.2.1 deprecation==2.0 +doc8==0.6.0 docutils==0.14 dogpile.cache==0.6.5 dulwich==0.19.0 diff --git a/specs/tenant_based_backups.rst b/specs/tenant_based_backups.rst index a2b165e7..bcca6479 100644 --- a/specs/tenant_based_backups.rst +++ b/specs/tenant_based_backups.rst @@ -8,7 +8,7 @@ Blueprint URL: Problem description =================== As a tenant, I need to use Freezer to backup all my data and metadata from an OS Cloud and restore it -at my convenience. With this approach all the data can be restored on the same Cloud platform (in case anything went lost) or on an independent cloud (i.e. a new one freshly deployed on a different geographic location). +at my convenience. With this approach all the data can be restored on the same Cloud platform (in case anything went lost) or on an independent cloud (i.e. a new one freshly deployed on a different geographic location). Tenants needs to backup selectively all their resources from a the OS services. These resources/services are: diff --git a/test-requirements.txt b/test-requirements.txt index 5d2b7acb..d44d38c9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -19,3 +19,7 @@ tempest>=17.1.0 # Apache-2.0 # Used in integration tests python-openstackclient>=3.12.0 # Apache-2.0 + +# Used in doc8 check +doc8>=0.6.0 # Apache-2.0 +Pygments>=2.2.0 # BSD license diff --git a/tox.ini b/tox.ini index 33883c2b..17ef395a 100644 --- a/tox.ini +++ b/tox.ini @@ -77,7 +77,9 @@ commands = [testenv:pep8] -commands = flake8 freezer +commands = + flake8 freezer + doc8 {posargs} [testenv:pylint] commands = pylint --rcfile .pylintrc freezer @@ -88,6 +90,10 @@ show-source = True enable-extensions = H203,H106 exclude = .venv,.tox,dist,doc,test,*egg,releasenotes +[doc8] +ignore = D000,D001 +ignore-path = .venv,.git,.tox,.tmp,*freezer/locale*,*lib/python*,freezer.egg*,doc/build,releasenotes/*,doc/source/contributor/api + [testenv:releasenotes] commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html