From 7d76c405e4bdc40ab405707ebb4203f5ca11377c Mon Sep 17 00:00:00 2001
From: jiansong <jian.song@easystack.cn>
Date: Tue, 19 Dec 2017 00:37:04 -0800
Subject: [PATCH] Follow the new PTI for document build

For compliance with the Project Testing Interface as described in:

https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I7615e33c0d00c56b3ee6cb856a0553e32a1664c6
---
 doc/requirements.txt  |  4 ++++
 test-requirements.txt |  3 ---
 tox.ini               | 11 +++++++++--
 3 files changed, 13 insertions(+), 5 deletions(-)
 create mode 100644 doc/requirements.txt

diff --git a/doc/requirements.txt b/doc/requirements.txt
new file mode 100644
index 000000000..8df1a2055
--- /dev/null
+++ b/doc/requirements.txt
@@ -0,0 +1,4 @@
+# These are needed for docs generation
+openstackdocstheme>=1.17.0 # Apache-2.0
+reno>=2.5.0 # Apache-2.0
+sphinx>=1.6.2 # BSD
diff --git a/test-requirements.txt b/test-requirements.txt
index 3112d94b7..891c48fc2 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -7,10 +7,7 @@ coverage!=4.4,>=4.0 # Apache-2.0
 ddt>=1.0.1 # MIT
 fixtures>=3.0.0 # Apache-2.0/BSD
 mock>=2.0.0 # BSD
-openstackdocstheme>=1.17.0 # Apache-2.0
-reno>=2.5.0 # Apache-2.0
 requests-mock>=1.1.0 # Apache-2.0
-sphinx>=1.6.2 # BSD
 tempest>=17.1.0 # Apache-2.0
 testtools>=2.2.0 # MIT
 testrepository>=0.0.18 # Apache-2.0/BSD
diff --git a/tox.ini b/tox.ini
index 5f363f982..62a2f791f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -48,10 +48,17 @@ commands =
     coverage xml -o cover/coverage.xml
 
 [testenv:docs]
-commands=
-    python setup.py build_sphinx
+deps =
+  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
+  -r{toxinidir}/requirements.txt
+  -r{toxinidir}/doc/requirements.txt
+commands = sphinx-build -b html doc/source doc/build/html
 
 [testenv:releasenotes]
+deps =
+  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
+  -r{toxinidir}/requirements.txt
+  -r{toxinidir}/doc/requirements.txt
 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
 
 [testenv:functional]