Reconfigure tox

Update minversion of tox to 3.9.0 to allow inline comments.

Add skipsdist and ignore_basepython_conflict for better compatibility
and to use correct python version when specified.

Move pep8 test requirements to tox.ini for easier management and update
requirement versions.

Fix a small typo found with new pep8 deps.

Add py27 constraints file for Python 2.7 tox jobs.

Use wallaby jobs.

Remove lower-constraints (it was not used anyway).

Fix docs job

Change-Id: I1132814a86b46a154b3a8eed5bc3e73ad7950589
This commit is contained in:
Riccardo Pittau 2021-01-27 10:20:30 +01:00
parent 3a27b3b7fa
commit 16b62119d7
10 changed files with 36 additions and 51 deletions

5
doc/requirements.txt Normal file
View File

@ -0,0 +1,5 @@
sphinx>=2.0.0,!=2.1.0 # BSD
openstackdocstheme>=2.2.1 # Apache-2.0
sphinxcontrib-apidoc>=0.2.0 # BSD

View File

@ -15,8 +15,6 @@
import os import os
import sys import sys
from pyghmi.version import version_info
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
@ -49,16 +47,6 @@ master_doc = 'index'
project = u'pyghmi' project = u'pyghmi'
copyright = u'2013, Jarrod Johnson <jbjohnso@us.ibm.com>' copyright = u'2013, Jarrod Johnson <jbjohnso@us.ibm.com>'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = version_info.release_string()
# The short X.Y version.
version = version_info.version_string()
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
# language = None # language = None
@ -128,7 +116,7 @@ html_theme = 'openstackdocs'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] # html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. # using the given strftime format.

View File

@ -1,13 +0,0 @@
coverage===4.0
cryptography===2.1
fixtures===3.0.0
flake8-import-order==0.17.1
openstackdocstheme==1.18.1
oslotest===3.2.0
python-dateutil==2.8.1
python-subunit===1.0.0
six==1.10.0
Sphinx===1.6.5
stestr==1.0.0
testscenarios===0.4
testtools===2.2.0

1
py27-constraints.txt Normal file
View File

@ -0,0 +1 @@
stestr==2.6.0 # Apache-2.0

View File

@ -246,7 +246,7 @@ def decode_eventdata(sensor_type, offset, eventdata, sdr):
else: else:
return 'Before' return 'Before'
elif sensor_type == 0x19 and offset == 0: elif sensor_type == 0x19 and offset == 0:
return 'Requested {0] while {1}'.format(eventdata[1], eventdata[2]) return 'Requested {0} while {1}'.format(eventdata[1], eventdata[2])
elif sensor_type == 0x1d and offset == 7: elif sensor_type == 0x1d and offset == 7:
return restart_causes.get(eventdata[1], 'Unknown') return restart_causes.get(eventdata[1], 'Unknown')
elif sensor_type == 0x21: elif sensor_type == 0x21:

View File

@ -1,3 +1,5 @@
cryptography>=2.1 # BSD/Apache-2.0 cryptography>=2.1 # BSD/Apache-2.0
python-dateutil>=2.8.1 # BSD python-dateutil>=2.8.1 # BSD
six>=1.10.0 # MIT six>=1.10.0 # MIT

View File

@ -17,6 +17,7 @@ classifier =
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
[build_sphinx] [build_sphinx]
all_files = 1 all_files = 1

View File

@ -1,14 +1,9 @@
hacking>=3.0.0,<3.1.0 # Apache-2.0
coverage>=4.0 coverage>=4.0
fixtures>=3.0.0 fixtures>=3.0.0
python-subunit>=1.0.0 python-subunit>=1.0.0
sphinx>=1.6.5,<2.0.0;python_version=='2.7' # BSD stestr>=2.0.0,!=2.3.0,!=3.0.0 # Apache-2.0
sphinx>=1.6.5;python_version>='3.4' # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4 testscenarios>=0.4
testtools>=2.2.0 testtools>=2.2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0,<4;python_version<'3.6' # Apache-2.0
flake8-import-order>=0.17.1 # LGPLv3 oslotest>=3.2.0;python_version>='3.6' # Apache-2.0

36
tox.ini
View File

@ -1,6 +1,8 @@
[tox] [tox]
minversion = 2.8.1 minversion = 3.9.0
envlist = py27,py3,pep8 envlist = py27,py3,pep8
skipsdist = True
ignore_basepython_conflict=true
[testenv] [testenv]
basepython = python3 basepython = python3
@ -12,18 +14,25 @@ setenv = VIRTUAL_ENV={envdir}
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true} OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true} OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true} OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
deps = -r{toxinidir}/requirements.txt deps =
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = stestr run {posargs} -r{toxinidir}/requirements.txt
stestr slowest commands = stestr run --slowest {posargs}
[tox:jenkins]
sitepackages = True
[testenv:pep8] [testenv:pep8]
deps =
hacking>=3.1.0,<4.0.0 # Apache-2.0
flake8-import-order>=0.17.1 # LGPLv3
pycodestyle>=2.0.0,<2.7.0 # MIT
whitelist_externals = bash whitelist_externals = bash
commands = flake8 commands = flake8
[testenv:py27]
deps =
-c{toxinidir}/py27-constraints.txt
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:cover] [testenv:cover]
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
@ -35,7 +44,10 @@ commands =
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
[testenv:docs] [testenv:docs]
commands = python setup.py build_sphinx deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
@ -56,9 +68,3 @@ enable-extensions=H106,H203,H204,H205,H904
import-order-style = pep8 import-order-style = pep8
application-import-names = pyghmi application-import-names = pyghmi
filename = *.py filename = *.py
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt

View File

@ -8,7 +8,7 @@
templates: templates:
- check-requirements - check-requirements
- openstack-python-jobs - openstack-python-jobs
- openstack-python3-ussuri-jobs - openstack-python3-wallaby-jobs
- build-openstack-docs-pti - build-openstack-docs-pti
check: check:
jobs: jobs: