Fix pep8 issues and switch to py35 in tox.ini

This change also adds cornice-py3 environment to tox-tmpl.ini,
as previously it was added manually directly in tox.ini.

Change-Id: I6c0924ca4cc7a42b57af01312da21b94ed1efa85
This commit is contained in:
Vladyslav Drok 2016-12-22 14:56:42 +02:00
parent 42e1239e9d
commit ecaf3aa40f
9 changed files with 82 additions and 60 deletions

@ -1,6 +1,6 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py27,py27-nolxml,pypy,tg11,tg15,cornice,coverage,py34,py34-nolxml,pecan-dev27,pecan-dev34,pep8
envlist = py27,py27-nolxml,pypy,tg11,tg15,cornice,cornice-py3,coverage,py35,py35-nolxml,pecan-dev27,pecan-dev35,pep8
[common]
testtools=
@ -17,13 +17,13 @@ basedeps=
flask-restful
[axes]
python=py27,py34,pypy
python=py27,py35,pypy
sqlalchemy=sa5,sa6,sa7*
lxml=lxml*,nolxml
json=json*,simplejson
[axis:python]
deps =
deps =
{[common]testtools}
{[common]basedeps}
suds-jurko
@ -36,8 +36,8 @@ commands=
[axis:python:py27]
basepython=python2.7
[axis:python:py34]
basepython=python3.4
[axis:python:py35]
basepython=python3.5
[axis:sqlalchemy:sa5]
deps=
@ -76,6 +76,17 @@ commands=
{envbindir}/nosetests tests/test_cornice.py --with-xunit --xunit-file nosetests-{envname}.xml --verbose --with-coverage --cover-package wsmeext {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsmeext/cornice.py
[testenv:cornice-py3]
basepython = python3.5
usedevelop = {[testenv:cornice]usedevelop}
deps = {[testenv:cornice]deps}
# disable hash randomization
setenv =
PYTHONHASHSEED=0
commands =
{envbindir}/nosetests tests/test_cornice.py --with-xunit --xunit-file nosetests-{envname}.xml --verbose --with-coverage --cover-package wsmeext {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsmeext/cornice.py
[testenv:pecan-dev-base]
deps=
{[common]testtools}
@ -89,8 +100,8 @@ deps={[testenv:pecan-dev-base]deps}
commands=
{envbindir}/nosetests tests/pecantest --with-xunit --xunit-file nosetests-{envname}.xml --verbose {posargs}
[testenv:pecan-dev34]
basepython=python3.4
[testenv:pecan-dev35]
basepython=python3.5
deps={[testenv:pecan-dev-base]deps}
commands=
{envbindir}/nosetests tests/pecantest --with-xunit --xunit-file nosetests-{envname}.xml --verbose {posargs}
@ -127,6 +138,6 @@ commands = flake8 wsme wsmeext setup.py
commands = {posargs}
usedevelop=True
deps =
pbr
pbr
oslo.config
oslotest

103
tox.ini

@ -1,5 +1,5 @@
[tox]
envlist = py27,py27-nolxml,pypy,tg11,tg15,cornice,cornice-py3,coverage,py34,py34-nolxml,pecan-dev27,pecan-dev34,pep8
envlist = py27,py27-nolxml,pypy,tg11,tg15,cornice,cornice-py3,coverage,py35,py35-nolxml,pecan-dev27,pecan-dev35,pep8
[common]
testtools =
@ -33,13 +33,12 @@ commands =
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsmeext/cornice.py
[testenv:cornice-py3]
basepython = python3
basepython = python3.5
usedevelop = {[testenv:cornice]usedevelop}
deps = {[testenv:cornice]deps}
# disable hash randomization
setenv =
PYTHONHASHSEED=0
commands =
setenv =
PYTHONHASHSEED=0
commands =
{envbindir}/nosetests tests/test_cornice.py --with-xunit --xunit-file nosetests-{envname}.xml --verbose --with-coverage --cover-package wsmeext {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsmeext/cornice.py
@ -56,8 +55,8 @@ deps = {[testenv:pecan-dev-base]deps}
commands =
{envbindir}/nosetests tests/pecantest --with-xunit --xunit-file nosetests-{envname}.xml --verbose {posargs}
[testenv:pecan-dev34]
basepython = python3.4
[testenv:pecan-dev35]
basepython = python3.5
deps = {[testenv:pecan-dev-base]deps}
commands =
{envbindir}/nosetests tests/pecantest --with-xunit --xunit-file nosetests-{envname}.xml --verbose {posargs}
@ -381,7 +380,7 @@ deps =
simplejson
basepython = python2.7
[testenv:py34-sa5-lxml-json]
[testenv:py35-sa5-lxml-json]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -392,9 +391,9 @@ deps =
suds-jurko
SQLAlchemy<=0.5.99
lxml
basepython = python3.4
basepython = python3.5
[testenv:py34-sa5]
[testenv:py35-sa5]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -405,9 +404,9 @@ deps =
suds-jurko
SQLAlchemy<=0.5.99
lxml
basepython = python3.4
basepython = python3.5
[testenv:py34-sa5-lxml-simplejson]
[testenv:py35-sa5-lxml-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -419,9 +418,9 @@ deps =
SQLAlchemy<=0.5.99
lxml
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-sa5-simplejson]
[testenv:py35-sa5-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -433,9 +432,9 @@ deps =
SQLAlchemy<=0.5.99
lxml
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-sa5-nolxml-json]
[testenv:py35-sa5-nolxml-json]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -445,9 +444,9 @@ deps =
{[common]basedeps}
suds-jurko
SQLAlchemy<=0.5.99
basepython = python3.4
basepython = python3.5
[testenv:py34-sa5-nolxml]
[testenv:py35-sa5-nolxml]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -457,9 +456,9 @@ deps =
{[common]basedeps}
suds-jurko
SQLAlchemy<=0.5.99
basepython = python3.4
basepython = python3.5
[testenv:py34-sa5-nolxml-simplejson]
[testenv:py35-sa5-nolxml-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -470,9 +469,9 @@ deps =
suds-jurko
SQLAlchemy<=0.5.99
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-sa6-lxml-json]
[testenv:py35-sa6-lxml-json]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -483,9 +482,9 @@ deps =
suds-jurko
SQLAlchemy<=0.6.99
lxml
basepython = python3.4
basepython = python3.5
[testenv:py34-sa6]
[testenv:py35-sa6]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -496,9 +495,9 @@ deps =
suds-jurko
SQLAlchemy<=0.6.99
lxml
basepython = python3.4
basepython = python3.5
[testenv:py34-sa6-lxml-simplejson]
[testenv:py35-sa6-lxml-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -510,9 +509,9 @@ deps =
SQLAlchemy<=0.6.99
lxml
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-sa6-simplejson]
[testenv:py35-sa6-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -524,9 +523,9 @@ deps =
SQLAlchemy<=0.6.99
lxml
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-sa6-nolxml-json]
[testenv:py35-sa6-nolxml-json]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -536,9 +535,9 @@ deps =
{[common]basedeps}
suds-jurko
SQLAlchemy<=0.6.99
basepython = python3.4
basepython = python3.5
[testenv:py34-sa6-nolxml]
[testenv:py35-sa6-nolxml]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -548,9 +547,9 @@ deps =
{[common]basedeps}
suds-jurko
SQLAlchemy<=0.6.99
basepython = python3.4
basepython = python3.5
[testenv:py34-sa6-nolxml-simplejson]
[testenv:py35-sa6-nolxml-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -561,9 +560,9 @@ deps =
suds-jurko
SQLAlchemy<=0.6.99
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-sa7-lxml-json]
[testenv:py35-sa7-lxml-json]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -574,9 +573,9 @@ deps =
suds-jurko
SQLAlchemy<=0.7.99
lxml
basepython = python3.4
basepython = python3.5
[testenv:py34]
[testenv:py35]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -587,9 +586,9 @@ deps =
suds-jurko
SQLAlchemy<=0.7.99
lxml
basepython = python3.4
basepython = python3.5
[testenv:py34-sa7-lxml-simplejson]
[testenv:py35-sa7-lxml-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -601,9 +600,9 @@ deps =
SQLAlchemy<=0.7.99
lxml
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-simplejson]
[testenv:py35-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -615,9 +614,9 @@ deps =
SQLAlchemy<=0.7.99
lxml
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-sa7-nolxml-json]
[testenv:py35-sa7-nolxml-json]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -627,9 +626,9 @@ deps =
{[common]basedeps}
suds-jurko
SQLAlchemy<=0.7.99
basepython = python3.4
basepython = python3.5
[testenv:py34-nolxml]
[testenv:py35-nolxml]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -639,9 +638,9 @@ deps =
{[common]basedeps}
suds-jurko
SQLAlchemy<=0.7.99
basepython = python3.4
basepython = python3.5
[testenv:py34-sa7-nolxml-simplejson]
[testenv:py35-sa7-nolxml-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -652,9 +651,9 @@ deps =
suds-jurko
SQLAlchemy<=0.7.99
simplejson
basepython = python3.4
basepython = python3.5
[testenv:py34-nolxml-simplejson]
[testenv:py35-nolxml-simplejson]
commands =
{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
@ -665,7 +664,7 @@ deps =
suds-jurko
SQLAlchemy<=0.7.99
simplejson
basepython = python3.4
basepython = python3.5
[testenv:pypy-sa5-lxml-json]
commands =

@ -182,6 +182,7 @@ class signature(object):
fd.set_arg_types(argspec, self.arg_types)
return func
sig = signature

@ -148,6 +148,7 @@ class MiniCrud(object):
ref.name = u('test')
return CRUDResult(ref, u('delete'))
wsme.tests.protocol.WSTestRoot.crud = MiniCrud()

@ -135,6 +135,7 @@ class BinaryType(UserType):
return None
return base64.decodestring(value)
#: The binary almost-native type
binary = BinaryType()
@ -325,6 +326,7 @@ class UnsetType(object):
def __repr__(self):
return 'Unset'
Unset = UnsetType()
#: A special type that corresponds to the host framework request object.
@ -741,6 +743,7 @@ class Registry(object):
type_ = self.register(type_)
return type_
# Default type registry
registry = Registry()

@ -43,6 +43,7 @@ class XMLRenderer(object):
namespace['datatype']
)
pecan.templating._builtin_renderers['wsmejson'] = JSonRenderer
pecan.templating._builtin_renderers['wsmexml'] = XMLRenderer

@ -28,6 +28,7 @@ class NS(object):
def qn(self, name):
return '{%s}%s' % (self.url, name)
wsdl_ns = NS("http://schemas.xmlsoap.org/wsdl/")
soap_ns = NS("http://schemas.xmlsoap.org/wsdl/soap/")
xs_ns = NS("http://www.w3.org/2001/XMLSchema")

@ -91,6 +91,7 @@ class CRUDControllerBase(object):
self.__dbsession__.flush()
return None
CRUDController = CRUDControllerMeta(
'CRUDController', (CRUDControllerBase,), {}
)

@ -28,6 +28,7 @@ class XDecimal(suds.xsd.sxbuiltin.XBuiltin):
return str(value)
return value
suds.xsd.sxbuiltin.Factory.tags['decimal'] = XDecimal
@ -83,6 +84,7 @@ class SudsCache(suds.cache.Cache):
def clear(self, id):
self.d = {}
sudscache = SudsCache()
tns = "http://foo.bar.baz/soap/"
@ -200,6 +202,7 @@ def tosuds(client, value):
def read_bool(value):
return value == 'true'
soap_types = {
'xs:string': wsme.types.text,
'xs:int': int,
@ -244,6 +247,7 @@ def tobin(value):
value = base64.decodestring(value.encode())
return value
fromsuds_types = {
wsme.types.binary: tobin,
wsme.types.bytes: tobytes,