summaryrefslogtreecommitdiffstats
path: root/tox.ini
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2015-08-16 19:00:00 +0200
committerChristian Heimes <cheimes@redhat.com>2015-08-17 21:14:12 +0200
commitc46caa19d9e1fb429fd77693abcca2fe668366aa (patch)
treebb5ed5f4c2987959b53c4390783ae67f1d3a16d6 /tox.ini
parent1c7a2735c82d6af1a871efd2c01f942387821a1f (diff)
downloadpki-c46caa19d9e1fb429fd77693abcca2fe668366aa.tar.gz
pki-c46caa19d9e1fb429fd77693abcca2fe668366aa.tar.xz
pki-c46caa19d9e1fb429fd77693abcca2fe668366aa.zip
Py3 modernization: misc manual fixes
Python 3's exception class has no message attribute. e.message can either be replaced with string representation of e or e.args[0]. Use print(line, end='') instead of sys.stdout.write(). With end='' no new line is appended. Use six.reraise() to reraise an exception. Remove sys.exc_clear() as it is no longer available in Python 3. Conditionally import shutil.WindowsError. Use six.move to import correct modules / function like quote, urlparse and configparser. Silence some pylint warnings. pylint doesn't understand six.moves magic and emits a import-error warning. Add additional tox envs to check for Python 3 compatibility.
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini27
1 files changed, 19 insertions, 8 deletions
diff --git a/tox.ini b/tox.ini
index 95fddb8c2..748e3d0db 100644
--- a/tox.ini
+++ b/tox.ini
@@ -19,7 +19,7 @@
#
[tox]
-envlist = py27,pep8,lint,docs
+envlist = py27,pep8,pep8py3,lint,lint3k,docs
[testenv]
# force installation of sphinx and lint in virtual env, otherwise
@@ -27,8 +27,6 @@ envlist = py27,pep8,lint,docs
install_command = pip install {opts} --force-reinstall --upgrade {packages}
deps =
pytest
-
-[testenv:py27]
sitepackages = True
commands =
{envpython} {envbindir}/pkidestroy --help
@@ -40,7 +38,6 @@ commands =
[testenv:lint]
basepython = python2.7
-sitepackages = True
deps =
pylint
commands =
@@ -48,12 +45,18 @@ commands =
[testenv:lint3k]
basepython = python2.7
-sitepackages = True
deps =
pylint
commands =
{envpython} {toxinidir}/scripts/pylint-build-scan.py tox -- --py3k
+[testenv:lint3]
+basepython = python3.4
+deps =
+ pylint
+commands =
+ {envpython} {toxinidir}/scripts/pylint-build-scan.py tox
+
[testenv:pep8]
basepython = python2.7
sitepackages = False
@@ -64,9 +67,18 @@ deps =
commands =
flake8 {posargs}
+[testenv:pep8py3]
+basepython = python3.4
+sitepackages = False
+deps =
+ flake8
+ # flake8-import-order
+ pep8-naming
+commands =
+ flake8 {posargs}
+
[testenv:docs]
basepython = python2.7
-sitepackages = True
changedir = base/common/python
deps =
sphinx < 1.3.0
@@ -82,5 +94,4 @@ exclude = .tox,*.egg,dist,build,conf.py,tests/*,.git
filename = *.py,pki,pkidestroy,pki-upgrade,pki-server,pki-server-upgrade,pkispawn,[0-9][0-9]-*
show-source = true
max-line-length = 99
-application-import-names = pki
-
+# application-import-names = pki