[Gate Fix]Switch to stestr

According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

This commit also updates Sphinx version in requirement.txt
Also, switch from oslosphinx to openstackdocstheme

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I1d4071d5154f1f24f57b05a46771f9c243bb56b6
This commit is contained in:
akhiljain23 2019-06-17 15:53:45 +05:30 committed by Akhil jain
parent 2de25b5f64
commit 19c1d1a683
8 changed files with 40 additions and 26 deletions

5
.gitignore vendored
View File

@ -27,7 +27,7 @@ cover/
!.coveragerc
.tox
nosetests.xml
.testrepository
.stestr
.venv
# Translations
@ -55,4 +55,5 @@ ChangeLog
.*sw?
# Files created by releasenotes build
releasenotes/build
releasenotes/build

4
.stestr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=./masakariclient/tests/unit
top_dir=./

View File

@ -1,7 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -21,9 +21,9 @@ sys.path.insert(0, os.path.abspath('../..'))
# 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',
'openstackdocstheme',
'sphinx.ext.autodoc'
#'sphinx.ext.intersphinx',
'oslosphinx'
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
@ -55,7 +55,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
# html_theme_path = ["."]
# html_theme = '_theme'
html_theme = 'openstackdocs'
# html_static_path = ['static']
# Output file base name for HTML help builder.
@ -73,3 +73,10 @@ latex_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}
# -- Options for openstackdocstheme ---------------------------------------
repository_name = 'openstack/python-masakariclient'
bug_project = 'python-masakariclient'
bug_tag = ''

View File

@ -33,15 +33,14 @@ msgpack-python==0.4.0
munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
openstackdocstheme==1.18.1
openstacksdk==0.13.0
os-client-config==1.28.0
os-service-types==1.2.0
os-testr==1.0.0
osc-lib==1.8.0
oslo.i18n==3.15.3
oslo.serialization==2.18.0
oslo.utils==3.33.0
oslosphinx==4.7.0
oslotest==3.2.0
pbr==2.0.0
pep8==1.5.7

View File

@ -38,7 +38,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'oslosphinx',
'openstackdocstheme',
'reno.sphinxext',
]
@ -111,7 +111,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -191,6 +191,11 @@ html_static_path = ['_static']
# Output file base name for HTML help builder.
htmlhelp_basename = 'MasakariClientReleaseNotesdoc'
# -- Options for openstackdocstheme ---------------------------------------
repository_name = 'openstack/python-masakariclient'
bug_project = 'python-masakariclient'
bug_tag = ''
# -- Options for LaTeX output ---------------------------------------------

View File

@ -7,12 +7,12 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT
python-subunit>=1.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
oslosphinx>=4.7.0 # Apache-2.0
openstackdocstheme>=1.18.1 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT

17
tox.ini
View File

@ -13,31 +13,30 @@ whitelist_externals = bash
find
rm
env
# By default ostestr will set concurrency
# By default stestr will set concurrency
# to ncpu, to specify something else use
# the concurrency=<n> option.
# call ie: 'tox -epy27 -- --concurrency=4'
commands =
find . -type f -name "*.pyc" -delete
rm -Rf .testrepository/times.dbm
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OS_DEBUG GENERATE_HASHES
[testenv:py27]
commands =
{[testenv]commands}
ostestr '{posargs}'
stestr run {posargs}
[testenv:py35]
basepython = python3
commands =
{[testenv]commands}
ostestr '{posargs}'
stestr run {posargs}
[testenv:py36]
basepython = python3.6
commands =
{[testenv]commands}
ostestr '{posargs}'
stestr run {posargs}
[testenv:pep8]
basepython = python3
@ -49,7 +48,13 @@ commands = {posargs}
[testenv:cover]
basepython = python3
commands = python setup.py test --coverage --testr-args='{posargs}'
setenv =
PYTHON=coverage run --source masakariclient --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
basepython = python3