Shift doc requirements to doc/requirements.txt

This is the new hotness.

Add doc8 linting to the pep8 target while we're doing it. And, slim down
pep8 tox env. It doesn't need to install shade or any of the
requirements.

Change-Id: I1e73ee503c81f92b4fe84bdd384f856290b6d5dd
This commit is contained in:
Monty Taylor 2018-01-24 04:15:57 -06:00
parent 4772c2285b
commit 52d7d845b4
6 changed files with 29 additions and 76 deletions

3
doc/requirements.txt Normal file
View File

@ -0,0 +1,3 @@
sphinx!=1.6.6,>=1.6.2 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0

View File

@ -73,7 +73,8 @@ All objects should be normalized. It is shade's purpose in life to make
OpenStack consistent for end users, and this means not trusting the clouds
to return consistent objects. There should be a normalize function in
`shade/_normalize.py` that is applied to objects before returning them to
the user. See :doc:`../user/model` for further details on object model requirements.
the user. See :doc:`../user/model` for further details on object model
requirements.
Fields should not be in the normalization contract if we cannot commit to
providing them to all users.

View File

@ -2,9 +2,11 @@
Usage
=====
To use shade in a project::
To use shade in a project:
import shade
.. code-block:: python
import shade
For a simple example, see :ref:`example`.
@ -17,6 +19,3 @@ For a simple example, see :ref:`example`.
.. autoclass:: shade.OpenStackCloud
:members:
.. autoclass:: shade.OperatorCloud
:members:

View File

@ -1,52 +0,0 @@
#!/bin/bash -x
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
export SHADE_DIR="$BASE/new/shade"
cd $SHADE_DIR
sudo chown -R jenkins:stack $SHADE_DIR
CLOUDS_YAML=/etc/openstack/clouds.yaml
if [ ! -e ${CLOUDS_YAML} ]
then
# stable/liberty had clouds.yaml in the home/base directory
sudo mkdir -p /etc/openstack
sudo cp $BASE/new/.config/openstack/clouds.yaml ${CLOUDS_YAML}
sudo chown -R jenkins:stack /etc/openstack
fi
# Devstack runs both keystone v2 and v3. An environment variable is set
# within the shade keystone v2 job that tells us which version we should
# test against.
if [ ${SHADE_USE_KEYSTONE_V2:-0} -eq 1 ]
then
sudo sed -ie "s/identity_api_version: '3'/identity_api_version: '2.0'/g" $CLOUDS_YAML
sudo sed -ie '/^.*domain_id.*$/d' $CLOUDS_YAML
fi
if [ "x$1" = "xtips" ] ; then
tox_env=functional-tips
else
tox_env=functional
fi
echo "Running shade functional test suite"
set +e
sudo -E -H -u jenkins tox -e$tox_env
EXIT_CODE=$?
sudo stestr last --subunit > $WORKSPACE/tempest.subunit
.tox/$tox_env/bin/pbr freeze
set -e
exit $EXIT_CODE

View File

@ -1,17 +1,12 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking<0.12,>=0.11.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
openstackdocstheme>=1.18.1 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
requests-mock>=1.1.0 # Apache-2.0
sphinx!=1.6.6,>=1.6.2 # BSD
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0

33
tox.ini
View File

@ -25,17 +25,17 @@ passenv = OS_* SHADE_* UPPER_CONSTRAINTS_FILE
commands = stestr --test-path ./shade/tests/functional run --serial {posargs}
stestr slowest
[testenv:functional-tips]
basepython = {env:SHADE_TOX_PYTHON:python2}
passenv = OS_* SHADE_* UPPER_CONSTRAINTS_FILE
whitelist_externals = bash
commands =
bash -x {toxinidir}/extras/install-tips.sh
stestr --test-path ./shade/tests/functional run --serial {posargs}
stestr slowest
[testenv:pep8]
commands = flake8 shade
usedevelop = False
skip_install = True
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
doc8
hacking
pygments
commands =
doc8 doc/source
flake8 shade
[testenv:venv]
commands = {posargs}
@ -67,11 +67,18 @@ deps =
commands = {toxinidir}/extras/run-ansible-tests.sh -e {envdir} {posargs}
[testenv:docs]
skip_install = True
deps = -r{toxinidir}/test-requirements.txt
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 -W -d doc/build/doctrees -b html doc/source/ doc/build/html
[testenv:releasenotes]
skip_install = True
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]