fix tox python3 overrides
We want to default to running all tox environments under python 3, so set the basepython value in each environment. We do not want to specify a minor version number, because we do not want to have to update the file every time we upgrade python. We do not want to set the override once in testenv, because that breaks the more specific versions used in default environments like py35 and py36. Change-Id: I9df9ee69b590e2589b7e687a7062bbfb19b6efbd Signed-off-by: Doug Hellmann <doug@doughellmann.com> Co-Authored-By: Nguyen Hai <nguyentrihai93@gmail.com> Co-Authored-By: Trinh Nguyen <dangtrinhnt@gmail.com>
This commit is contained in:
parent
29a4e902aa
commit
e7f6b83833
|
@ -16,7 +16,6 @@
|
|||
import abc
|
||||
import json
|
||||
import multiprocessing
|
||||
from multiprocessing import queues
|
||||
import shutil
|
||||
import tempfile
|
||||
import time
|
||||
|
@ -31,6 +30,12 @@ from freezer.storage import base
|
|||
from freezer.utils import streaming
|
||||
from freezer.utils import utils
|
||||
|
||||
if six.PY3:
|
||||
from multiprocessing import SimpleQueue
|
||||
else:
|
||||
from multiprocessing.queues import SimpleQueue
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -249,10 +254,7 @@ class BackupEngine(object):
|
|||
max_level = max(backups.keys())
|
||||
|
||||
# Use SimpleQueue because Queue does not work on Mac OS X.
|
||||
if six.PY2:
|
||||
read_except_queue = queues.SimpleQueue()
|
||||
else:
|
||||
read_except_queue = multiprocessing.SimpleQueue()
|
||||
read_except_queue = SimpleQueue()
|
||||
LOG.info("Restoring backup {0}".format(hostname_backup_name))
|
||||
for level in range(0, max_level + 1):
|
||||
LOG.info("Restoring from level {0}".format(level))
|
||||
|
@ -269,10 +271,7 @@ class BackupEngine(object):
|
|||
# Start the tar pipe consumer process
|
||||
|
||||
# Use SimpleQueue because Queue does not work on Mac OS X.
|
||||
if six.PY2:
|
||||
write_except_queue = queues.SimpleQueue()
|
||||
else:
|
||||
write_except_queue = multiprocessing.SimpleQueue()
|
||||
write_except_queue = SimpleQueue()
|
||||
|
||||
engine_stream = multiprocessing.Process(
|
||||
target=self.restore_level,
|
||||
|
|
5
tox.ini
5
tox.ini
|
@ -45,6 +45,7 @@ python_files = test_*.py
|
|||
norecursedirs = .tox .venv
|
||||
|
||||
[testenv:venv]
|
||||
basepython = python3
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:py27]
|
||||
|
@ -57,6 +58,7 @@ basepython = python3.5
|
|||
basepython = python3.6
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python3
|
||||
deps = -r{toxinidir}/doc/requirements.txt
|
||||
whitelist_externals = rm
|
||||
commands =
|
||||
|
@ -65,11 +67,13 @@ commands =
|
|||
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python3
|
||||
commands =
|
||||
flake8 freezer
|
||||
doc8 {posargs}
|
||||
|
||||
[testenv:pylint]
|
||||
basepython = python3
|
||||
commands = pylint --rcfile .pylintrc freezer
|
||||
|
||||
[flake8]
|
||||
|
@ -83,6 +87,7 @@ ignore = D000,D001
|
|||
ignore-path = .venv,.git,.tox,.tmp,*freezer/locale*,*lib/python*,freezer.egg*,doc/build,releasenotes/*,doc/source/contributor/api
|
||||
|
||||
[testenv:releasenotes]
|
||||
basepython = python3
|
||||
deps = -r{toxinidir}/doc/requirements.txt
|
||||
whitelist_externals = rm
|
||||
commands =
|
||||
|
|
Loading…
Reference in New Issue