tox: Misc fixes

- Use 'ignore_basepython_conflict' so we can simply define 'basepython'
  on the base testenv
- Add an '.stestr.conf' file, allowing us to stop specifying the
  '--test-path' argument manually
- Call 'sphinx-build' directly instead of using the 'build_sphinx'
  distutils extension, which pbr is deprecating. This requires a fix to
  the docs but allows us to remove some noise from 'setup.cfg'
- Fix some indentation and remove some unnecessary configuration

Change-Id: Icc16ed943d8c0b9df01734da5642bf51e83314b8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2019-06-06 11:34:52 +01:00
parent dacb35cae2
commit f35ffb70b5
4 changed files with 17 additions and 57 deletions

3
.stestr.conf Normal file
View File

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

View File

@ -15,7 +15,7 @@ Identity, Image.
install-sh.rst
install-manual.rst
install-devstack.rst
install-ubuntu.rst
.. toctree::
:maxdepth: 1

View File

@ -25,10 +25,6 @@ classifier =
packages =
ec2api
[global]
setup-hooks =
pbr.hooks.setup_hook
[entry_points]
oslo.config.opts =
ec2api = ec2api.opts:list_opts
@ -36,23 +32,12 @@ oslo.config.opts =
keystoneauth1 = ec2api.opts:list_auth_opts
ec2api.metadata = ec2api.metadata.opts:list_opts
ec2api.s3 = ec2api.s3.opts:list_opts
console_scripts =
ec2-api=ec2api.cmd.api:main
ec2-api-manage=ec2api.cmd.manage:main
ec2-api-metadata=ec2api.cmd.api_metadata:main
ec2-api-s3=ec2api.cmd.api_s3:main
[build_sphinx]
all_files = 1
build-dir = doc/build
source-dir = doc/source
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
[compile_catalog]
directory = ec2api/locale
domain = ec2api

52
tox.ini
View File

@ -1,46 +1,22 @@
[tox]
minversion = 2.1
envlist = py27,py37,pep8,docs,api-ref
minversion = 3.1
envlist = pep8,py27,py37,docs,api-ref
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
# tox is silly... these need to be separated by a newline....
whitelist_externals = bash
find
rm
env
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
setenv =
PYTHONDONTWRITEBYTECODE=1
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
rm -f .testrepository/times.dbm
[testenv:py27]
commands =
{[testenv]commands}
stestr --test-path 'ec2api/tests/unit' run '{posargs}'
stestr slowest
[testenv:py35]
commands =
{[testenv]commands}
stestr --test-path 'ec2api/tests/unit' run '{posargs}'
stestr slowest
[testenv:py36]
commands =
{[testenv]commands}
stestr --test-path 'ec2api/tests/unit' run '{posargs}'
stestr run {posargs}
stestr slowest
[testenv:pep8]
basepython = python3
commands =
flake8 {posargs}
@ -48,18 +24,20 @@ commands =
commands = oslo-config-generator --config-file=etc/ec2api/ec2api-config-generator.conf
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
# This environment is called from CI scripts to test and publish
# the API Ref and Docs to docs.openstack.org.
commands = python setup.py build_sphinx
whitelist_externals = rm
commands =
rm -rf doc/build
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to docs.openstack.org.
whitelist_externals = rm
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
@ -69,7 +47,6 @@ commands =
# in sqlalchemy.
# TODO Hacking 0.6 checks to fix
# H102 Apache 2.0 license header not found
ignore = E121,E122,E123,E124,E126,E127,E128,E711,E712,H102,H303,H404,F403,F811,F841
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
@ -81,11 +58,6 @@ max-complexity=25
local-check-factory = ec2api.hacking.checks.factory
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
commands =
{[testenv]commands}
stestr --test-path 'ec2api/tests/unit' run '{posargs}'
stestr slowest