]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
tox: Switch non-pyNN targets to Python 3
authorStephen Finucane <stephen@that.guru>
Thu, 27 Feb 2020 23:13:54 +0000 (23:13 +0000)
committerStephen Finucane <stephen@that.guru>
Thu, 27 Feb 2020 23:17:32 +0000 (23:17 +0000)
This is long overdue and highlights a small issue, which is easily fixed
by use of Sphinx.

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/parser.py
tox.ini

index 5d86426c82b2f5bf74d0af294aff3d2c925a3e99..0e88d9345076e1189b18766cd31c97c0afcc7c79 100644 (file)
@@ -160,12 +160,7 @@ def clean_header(header):
     if sane_header is None:
         return None
 
-    # on Py2, we want to do unicode(), on Py3, str().
-    # That gets us the decoded, un-wrapped header.
-    if six.PY2:
-        header_str = unicode(sane_header)
-    else:
-        header_str = str(sane_header)
+    header_str = six.text_type(sane_header)
 
     return normalise_space(header_str)
 
diff --git a/tox.ini b/tox.ini
index 140c19246dd162d4200f50ade3542868e90e5bad..1b6cadaad1754bd7eba0a81090a82856471069da 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,9 +1,11 @@
 [tox]
-minversion = 2.0
+minversion = 3.2
 envlist = pep8,docs,py27-django111,py{35,36,37,38}-django{111,20,21,22}
-skipsdist = True
+skipsdist = true
+ignore_basepython_conflict = true
 
 [testenv]
+basepython = python3
 deps =
     -r{toxinidir}/requirements-test.txt
     django111: django>=1.11,<2.0
@@ -42,7 +44,6 @@ commands =
     -name \*.sh -print | xargs bashate -i E006"
 
 [testenv:pep8]
-basepython = python2.7
 deps = flake8
 commands = flake8 {posargs:patchwork manage.py}
 
@@ -62,7 +63,6 @@ commands =
     sphinx-build -E -W -b dirhtml -d docs/_build/doctrees docs docs/_build/html
 
 [testenv:lint]
-basepython = python2.7
 deps =
     pylint
     -r{toxinidir}/requirements-prod.txt
@@ -72,7 +72,6 @@ commands = pylint patchwork --rcfile=pylint.rc
 commands = {posargs}
 
 [testenv:coverage]
-basepython = python2.7
 deps =
     coverage
     -r{toxinidir}/requirements-dev.txt