[Python-modules-commits] [tox] 04/18: Import tox_1.9.2.orig.tar.gz
Barry Warsaw
barry at moszumanska.debian.org
Tue Apr 28 17:44:44 UTC 2015
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository tox.
commit 5266482aa1f51e4698400c9cd0f9618f7f79af49
Author: Barry Warsaw <barry at python.org>
Date: Tue Apr 28 11:53:36 2015 -0400
Import tox_1.9.2.orig.tar.gz
---
CHANGELOG | 61 ++++++++++++++++++++++++-
CONTRIBUTORS | 2 +
PKG-INFO | 2 +-
doc/announce/release-1.8.txt | 2 +-
doc/announce/release-1.9.txt | 66 +++++++++++++++++++++++++++
doc/conf.py | 4 +-
doc/config.txt | 37 ++++++++++++++-
doc/example/basic.txt | 43 ++++++++++++++++--
setup.py | 6 +--
tests/test_config.py | 104 +++++++++++++++++++++++++++++++++++++++++++
tests/test_quickstart.py | 23 ++++++----
tests/test_result.py | 12 +++++
tests/test_venv.py | 23 +++++++++-
tests/test_z_cmdline.py | 6 +--
tox.egg-info/PKG-INFO | 2 +-
tox.egg-info/SOURCES.txt | 1 +
tox.ini | 7 +--
tox/__init__.py | 2 +-
tox/_cmdline.py | 61 ++++++++++++++++++-------
tox/_config.py | 39 +++++++++++-----
tox/_pytestplugin.py | 15 ++++---
tox/_quickstart.py | 2 +-
tox/_venv.py | 21 +++++++--
tox/result.py | 11 ++---
24 files changed, 474 insertions(+), 78 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 62f2d3c..5f118e2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,62 @@
+1.9.2
+-----------
+
+- backout ability that --force-deps substitutes name/versions in
+ requirement files due to various issues.
+ This fixes issue228, fixes issue230, fixes issue231
+ which popped up with 1.9.1.
+
+1.9.1
+-----------
+
+- use a file instead of a pipe for command output in "--result-json".
+ Fixes some termination issues with python2.6.
+
+- allow --force-deps to override dependencies in "-r" requirements
+ files. Thanks Sontek for the PR.
+
+- fix issue227: use "-m virtualenv" instead of "-mvirtualenv" to make
+ it work with pyrun. Thanks Marc-Andre Lemburg.
+
+
+1.9.0
+-----------
+
+- fix issue193: Remove ``--pre`` from the default ``install_command``; by
+ default tox will now only install final releases from PyPI for unpinned
+ dependencies. Use ``pip_pre = true`` in a testenv or the ``--pre``
+ command-line option to restore the previous behavior.
+
+- fix issue199: fill resultlog structure ahead of virtualenv creation
+
+- refine determination if we run from Jenkins, thanks Borge Lanes.
+
+- echo output to stdout when ``--report-json`` is used
+
+- fix issue11: add a ``skip_install`` per-testenv setting which
+ prevents the installation of a package. Thanks Julian Krause.
+
+- fix issue124: ignore command exit codes; when a command has a "-" prefix,
+ tox will ignore the exit code of that command
+
+- fix issue198: fix broken envlist settings, e.g. {py26,py27}{-lint,}
+
+- fix issue191: lessen factor-use checks
+
+
+1.8.1
+-----------
+
+- fix issue190: allow setenv to be empty.
+
+- allow escaping curly braces with "\". Thanks Marc Abramowitz for the PR.
+
+- allow "." names in environment names such that "py27-django1.7" is a
+ valid environment name. Thanks Alex Gaynor and Alex Schepanovski.
+
+- report subprocess exit code when execution fails. Thanks Marius
+ Gedminas.
+
1.8.0
-----------
@@ -69,7 +128,7 @@
- merged PR125: tox now sets "PYTHONHASHSEED" to a random value
and offers a "--hashseed" option to repeat a test run with a specific seed.
- You can also use --hashsheed=notset to instruct tox to leave the value
+ You can also use --hashsheed=noset to instruct tox to leave the value
alone. Thanks Chris Jerdonek for all the work behind this.
- fix issue132: removing zip_safe setting (so it defaults to false)
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index ef8576d..b3e523e 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -24,8 +24,10 @@ Matt Good
Mattieu Agopian
Asmund Grammeltwedt
Ionel Maries Cristian
+Julian Krause
Alexandre Conrad
Morgan Fainberg
Marc Schlaich
Clark Boylan
Eugene Yunak
+Mark Hirota
diff --git a/PKG-INFO b/PKG-INFO
index ab41d25..e411bc0 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tox
-Version: 1.8.0
+Version: 1.9.2
Summary: virtualenv-based automation of test activities
Home-page: http://tox.testrun.org/
Author: holger krekel
diff --git a/doc/announce/release-1.8.txt b/doc/announce/release-1.8.txt
index 2318e54..b8a2218 100644
--- a/doc/announce/release-1.8.txt
+++ b/doc/announce/release-1.8.txt
@@ -3,7 +3,7 @@ tox 1.8: Generative/combinatorial environments specs
I am happy to announce tox 1.8 which implements parametrized environments.
-See https://tox.testrun.org/config.html#generating-environments-conditional-settings
+See https://tox.testrun.org/latest/config.html#generating-environments-conditional-settings
for examples and the new backward compatible syntax in your tox.ini file.
Many thanks to Alexander Schepanovski for implementing and refining
diff --git a/doc/announce/release-1.9.txt b/doc/announce/release-1.9.txt
new file mode 100644
index 0000000..96379b9
--- /dev/null
+++ b/doc/announce/release-1.9.txt
@@ -0,0 +1,66 @@
+tox-1.9: refinements, fixes (+detox-0.9.4)
+==========================================
+
+tox-1.9 was released to pypi, a maintenance release with mostly
+backward-compatible enhancements and fixes. However, tox now defaults
+to pip-installing only non-development releases and you have to set "pip_pre =
+True" in your testenv section to have it install development ("pre") releases.
+
+In addition, there is a new detox-0.9.4 out which allow to run tox test
+environments in parallel and fixes a compat problem with eventlet.
+
+Thanks to Alexander Schepanosvki, Florian Schulze and others for the
+contributed fixes and improvements.
+
+More documentation about tox in general:
+
+ http://tox.testrun.org/
+
+Installation:
+
+ pip install -U tox
+
+code hosting and issue tracking on bitbucket:
+
+ https://bitbucket.org/hpk42/tox
+
+What is tox?
+----------------
+
+tox standardizes and automates tedious test activities driven from a
+simple ``tox.ini`` file, including:
+
+* creation and management of different virtualenv environments
+ with different Python interpreters
+* packaging and installing your package into each of them
+* running your test tool of choice, be it nose, py.test or unittest2 or other tools such as "sphinx" doc checks
+* testing dev packages against each other without needing to upload to PyPI
+
+best,
+Holger Krekel, merlinux GmbH
+
+
+1.9.0
+-----------
+
+- fix issue193: Remove ``--pre`` from the default ``install_command``; by
+ default tox will now only install final releases from PyPI for unpinned
+ dependencies. Use ``pip_pre = true`` in a testenv or the ``--pre``
+ command-line option to restore the previous behavior.
+
+- fix issue199: fill resultlog structure ahead of virtualenv creation
+
+- refine determination if we run from Jenkins, thanks Borge Lanes.
+
+- echo output to stdout when ``--report-json`` is used
+
+- fix issue11: add a ``skip_install`` per-testenv setting which
+ prevents the installation of a package. Thanks Julian Krause.
+
+- fix issue124: ignore command exit codes; when a command has a "-" prefix,
+ tox will ignore the exit code of that command
+
+- fix issue198: fix broken envlist settings, e.g. {py26,py27}{-lint,}
+
+- fix issue191: lessen factor-use checks
+
diff --git a/doc/conf.py b/doc/conf.py
index 92ed895..9c573d7 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -48,8 +48,8 @@ copyright = u'2013, holger krekel and others'
# built documents.
#
# The short X.Y version.
-release = "1.8"
-version = "1.8.0"
+release = "1.9"
+version = "1.9.0"
# The full version, including alpha/beta/rc tags.
# The language for content autogenerated by Sphinx. Refer to documentation
diff --git a/doc/config.txt b/doc/config.txt
index 8ce64db..b5a717f 100644
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -86,6 +86,8 @@ Complete list of settings that you can put into ``testenv*`` sections:
will be appended (and may contain another ``\`` character ...).
For eventually performing a call to ``subprocess.Popen(args, ...)``
``args`` are determined by splitting the whole command by whitespace.
+ Similar to ``make`` recipe lines, any command with a leading ``-``
+ will ignore the exit code.
.. confval:: install_command=ARGV
@@ -106,7 +108,22 @@ Complete list of settings that you can put into ``testenv*`` sections:
**default**::
- pip install --pre {opts} {packages}
+ pip install {opts} {packages}
+
+.. confval:: pip_pre=True|False(default)
+
+ .. versionadded:: 1.9
+
+ If ``True``, adds ``--pre`` to the ``opts`` passed to
+ :confval:`install_command`. If :confval:`install_command` uses pip, this
+ will cause it to install the latest available pre-release of any
+ dependencies without a specified version. If ``False`` (the default), pip
+ will only install final releases of unpinned dependencies.
+
+ Passing the ``--pre`` command-line option to tox will force this to
+ ``True`` for all testenvs.
+
+ Don't set this option if your :confval:`install_command` does not use pip.
.. confval:: whitelist_externals=MULTI-LINE-LIST
@@ -237,6 +254,16 @@ Complete list of settings that you can put into ``testenv*`` sections:
**default**: ``False``
+.. confval:: skip_install=BOOL
+
+ .. versionadded:: 1.9
+
+ Do not install the current package. This can be used when you need the
+ virtualenv management but do not want to install the current package
+ into that environment.
+
+ **default**: ``False``
+
Substitutions
-------------
@@ -244,6 +271,10 @@ Substitutions
Any ``key=value`` setting in an ini-file can make use
of value substitution through the ``{...}`` string-substitution pattern.
+You can escape curly braces with the ``\`` character if you need them, for example::
+
+ commands = echo "\{posargs\}" = {posargs}
+
Globally available substitutions
++++++++++++++++++++++++++++++++
@@ -418,6 +449,8 @@ This uses two new facilities of tox-1.8:
Let's go through this step by step.
+.. _generative-envlist:
+
Generative envlist
+++++++++++++++++++++++
@@ -451,6 +484,8 @@ You can still list environments explicitly along with generated ones::
flake
+.. _factors:
+
Factors and factor-conditional settings
++++++++++++++++++++++++++++++++++++++++
diff --git a/doc/example/basic.txt b/doc/example/basic.txt
index 562e2bf..e0dbece 100644
--- a/doc/example/basic.txt
+++ b/doc/example/basic.txt
@@ -74,9 +74,9 @@ depending on requirements.txt
(experimental) If you have a ``requirements.txt`` file
you can add it to your ``deps`` variable like this::
- deps = -rrequirements.txt
+ deps = -rrequirements.txt
-All installation commands are executed using ``{toxinidir}}``
+All installation commands are executed using ``{toxinidir}``
(the directory where ``tox.ini`` resides) as the current
working directory. Therefore, the underlying ``pip`` installation
will assume ``requirements.txt`` to exist at ``{toxinidir}/requirements.txt``.
@@ -191,10 +191,14 @@ You can tell Tox to use an explicit hash seed value via the ``--hashseed``
command-line option to ``tox``. You can also override the hash seed value
per test environment in ``tox.ini`` as follows::
- [testenv:hash]
+ [testenv]
setenv =
PYTHONHASHSEED = 100
+If you wish to disable this feature, you can pass the command line option
+``--hashseed=noset`` when ``tox`` is invoked. You can also disable it from the
+``tox.ini`` by setting ``PYTHONHASHSEED = 0`` as described above.
+
.. _`in Python 3.3`: http://docs.python.org/3/whatsnew/3.3.html#builtin-functions-and-types
.. _PYTHONHASHSEED: http://docs.python.org/using/cmdline.html#envvar-PYTHONHASHSEED
@@ -240,3 +244,36 @@ using the ``--tox-args`` or ``-a`` command-line options. For example::
python setup.py test -a "-epy27"
is equivalent to running ``tox -epy27``.
+
+Ignoring a command exit code
+----------------------------
+
+In some cases, you may want to ignore a command exit code. For example::
+
+ [testenv:py27]
+ commands = coverage erase
+ {envbindir}/python setup.py develop
+ coverage run -p setup.py test
+ coverage combine
+ - coverage html
+ {envbindir}/flake8 loads
+
+By using the ``-`` prefix, similar to a ``make`` recipe line, you can ignore
+the exit code for that command.
+
+Compressing dependency matrix
+-----------------------------
+
+If you have a large matrix of dependencies, python versions and/or environments you can
+use :ref:`generative-envlist` and :ref:`conditional settings <factors>` to express that in a concise form::
+
+ [tox]
+ envlist = py{26,27,33}-django{15,16}-{sqlite,mysql}
+
+ [testenv]
+ deps =
+ django15: Django>=1.5,<1.6
+ django16: Django>=1.6,<1.7
+ py33-mysql: PyMySQL ; use if both py33 and mysql are in an env name
+ py26,py27: urllib3 ; use if any of py26 or py27 are in an env name
+ py{26,27}-sqlite: mock ; mocking sqlite in python 2.x
diff --git a/setup.py b/setup.py
index 3a9f9bc..e14f7aa 100644
--- a/setup.py
+++ b/setup.py
@@ -19,16 +19,14 @@ class Tox(TestCommand):
def main():
version = sys.version_info[:2]
install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', ]
- if version < (2, 7) or (3, 0) <= version <= (3, 1):
+ if version < (2, 7):
install_requires += ['argparse']
- if version < (2,6):
- install_requires += ["simplejson"]
setup(
name='tox',
description='virtualenv-based automation of test activities',
long_description=open("README.rst").read(),
url='http://tox.testrun.org/',
- version='1.8.0',
+ version='1.9.2',
license='http://opensource.org/licenses/MIT',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel',
diff --git a/tests/test_config.py b/tests/test_config.py
index efbbc80..f957771 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -106,6 +106,7 @@ class TestConfigPackage:
envconfig = config.envconfigs['python']
assert envconfig.args_are_paths
assert not envconfig.recreate
+ assert not envconfig.pip_pre
def test_defaults_distshare(self, tmpdir, newconfig):
config = newconfig([], "")
@@ -147,6 +148,20 @@ def test_get_homedir(monkeypatch):
assert get_homedir() == "123"
+class TestGetcontextname:
+ def test_blank(self, monkeypatch):
+ monkeypatch.setattr(os, "environ", {})
+ assert getcontextname() is None
+
+ def test_jenkins(self, monkeypatch):
+ monkeypatch.setattr(os, "environ", {"JENKINS_URL": "xyz"})
+ assert getcontextname() == "jenkins"
+
+ def test_hudson_legacy(self, monkeypatch):
+ monkeypatch.setattr(os, "environ", {"HUDSON_URL": "xyz"})
+ assert getcontextname() == "jenkins"
+
+
class TestIniParser:
def test_getdefault_single(self, tmpdir, newconfig):
config = newconfig("""
@@ -620,6 +635,24 @@ class TestConfigTestEnv:
'some_install', '--arg=%s/foo' % config.toxinidir, 'python',
'{opts}', '{packages}']
+ def test_pip_pre(self, newconfig):
+ config = newconfig("""
+ [testenv]
+ pip_pre=true
+ """)
+ envconfig = config.envconfigs['python']
+ assert envconfig.pip_pre
+
+ def test_pip_pre_cmdline_override(self, newconfig):
+ config = newconfig(
+ ['--pre'],
+ """
+ [testenv]
+ pip_pre=false
+ """)
+ envconfig = config.envconfigs['python']
+ assert envconfig.pip_pre
+
def test_downloadcache(self, newconfig, monkeypatch):
monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False)
config = newconfig("""
@@ -706,6 +739,23 @@ class TestConfigTestEnv:
assert argv[0] == ["cmd1", "[hello]", "world"]
assert argv[1] == ["cmd1", "brave", "new", "world"]
+ def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig):
+ inisource = """
+ [testenv:py24]
+ commands =
+ echo "\{posargs\}" = {posargs}
+ echo "posargs = " "{posargs}"
+ """
+ conf = newconfig([], inisource).envconfigs['py24']
+ argv = conf.commands
+ assert argv[0] == ['echo', '\\{posargs\\}', '=']
+ assert argv[1] == ['echo', 'posargs = ', ""]
+
+ conf = newconfig(['dog', 'cat'], inisource).envconfigs['py24']
+ argv = conf.commands
+ assert argv[0] == ['echo', '\\{posargs\\}', '=', 'dog', 'cat']
+ assert argv[1] == ['echo', 'posargs = ', 'dog cat']
+
def test_rewrite_posargs(self, tmpdir, newconfig):
inisource = """
[testenv:py24]
@@ -896,6 +946,60 @@ class TestConfigTestEnv:
assert configs["py27"].recreate
assert not configs["py33"].recreate
+ @pytest.mark.issue190
+ def test_factors_in_setenv(self, newconfig):
+ inisource="""
+ [tox]
+ envlist = py27,py26
+
+ [testenv]
+ setenv =
+ py27: X = 1
+ """
+ configs = newconfig([], inisource).envconfigs
+ assert configs["py27"].setenv["X"] == "1"
+ assert "X" not in configs["py26"].setenv
+
+ @pytest.mark.issue191
+ def test_factor_use_not_checked(self, newconfig):
+ inisource="""
+ [tox]
+ envlist = py27-{a,b}
+
+ [testenv]
+ deps = b: test
+ """
+ configs = newconfig([], inisource).envconfigs
+ assert set(configs.keys()) == set(['py27-a', 'py27-b'])
+
+ @pytest.mark.issue198
+ def test_factors_groups_touch(self, newconfig):
+ inisource="""
+ [tox]
+ envlist = {a,b}{-x,}
+
+ [testenv]
+ deps=
+ a,b,x,y: dep
+ """
+ configs = newconfig([], inisource).envconfigs
+ assert set(configs.keys()) == set(['a', 'a-x', 'b', 'b-x'])
+
+ def test_period_in_factor(self, newconfig):
+ inisource="""
+ [tox]
+ envlist = py27-{django1.6,django1.7}
+
+ [testenv]
+ deps =
+ django1.6: Django==1.6
+ django1.7: Django==1.7
+ """
+ configs = newconfig([], inisource).envconfigs
+ assert sorted(configs) == ["py27-django1.6", "py27-django1.7"]
+ assert [d.name for d in configs["py27-django1.6"].deps] \
+ == ["Django==1.6"]
+
class TestGlobalOptions:
def test_notest(self, newconfig):
diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py
index df8a98f..5aaacc2 100644
--- a/tests/test_quickstart.py
+++ b/tests/test_quickstart.py
@@ -37,6 +37,7 @@ class TestToxQuickstartMain(object):
'Y', # py32
'Y', # py33
'Y', # py34
+ 'Y', # py35
'Y', # pypy
'N', # jython
'py.test', # command to run tests
@@ -54,7 +55,7 @@ class TestToxQuickstartMain(object):
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy
+envlist = py26, py27, py32, py33, py34, py35, pypy
[testenv]
commands = py.test
@@ -77,6 +78,7 @@ deps =
'Y', # py32
'Y', # py33
'Y', # py34
+ 'Y', # py35
'Y', # pypy
'N', # jython
'nosetests', # command to run tests
@@ -94,7 +96,7 @@ deps =
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy
+envlist = py26, py27, py32, py33, py34, py35, pypy
[testenv]
commands = nosetests
@@ -117,6 +119,7 @@ deps =
'Y', # py32
'Y', # py33
'Y', # py34
+ 'Y', # py35
'Y', # pypy
'N', # jython
'trial', # command to run tests
@@ -134,7 +137,7 @@ deps =
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy
+envlist = py26, py27, py32, py33, py34, py35, pypy
[testenv]
commands = trial
@@ -157,6 +160,7 @@ deps =
'Y', # py32
'Y', # py33
'Y', # py34
+ 'Y', # py35
'Y', # pypy
'N', # jython
'py.test', # command to run tests
@@ -173,7 +177,7 @@ deps =
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy
+envlist = py26, py27, py32, py33, py34, py35, pypy
[testenv]
commands = py.test
@@ -272,7 +276,7 @@ deps =
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy, jython
+envlist = py26, py27, py32, py33, py34, py35, pypy, jython
[testenv]
commands = py.test
@@ -295,6 +299,7 @@ deps =
'', # py32
'', # py33
'', # py34
+ '', # py35
'', # pypy
'', # jython
'', # command to run tests
@@ -312,7 +317,7 @@ deps =
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy, jython
+envlist = py26, py27, py32, py33, py34, py35, pypy, jython
[testenv]
commands = {envpython} setup.py test
@@ -339,6 +344,7 @@ deps =
'', # py32
'', # py33
'', # py34
+ '', # py35
'', # pypy
'', # jython
'', # command to run tests
@@ -357,7 +363,7 @@ deps =
# and then run "tox" from this directory.
[tox]
-envlist = py26, py27, py32, py33, py34, pypy, jython
+envlist = py26, py27, py32, py33, py34, py35, pypy, jython
[testenv]
commands = {envpython} setup.py test
@@ -459,6 +465,7 @@ deps =
'py32': True,
'py33': True,
'py34': True,
+ 'py35': True,
'pypy': True,
'commands': 'nosetests -v',
'deps': 'nose',
@@ -470,7 +477,7 @@ deps =
# and then run "tox" from this directory.
[tox]
-envlist = py27, py32, py33, py34, pypy
+envlist = py27, py32, py33, py34, py35, pypy
[testenv]
commands = nosetests -v
diff --git a/tests/test_result.py b/tests/test_result.py
index 6df834a..206a99c 100644
--- a/tests/test_result.py
+++ b/tests/test_result.py
@@ -10,6 +10,18 @@ def pkg(tmpdir):
p.write("whatever")
return p
+def test_pre_set_header(pkg):
+ replog = ResultLog()
+ d = replog.dict
+ assert replog.dict == d
+ assert replog.dict["reportversion"] == "1"
+ assert replog.dict["toxversion"] == tox.__version__
+ assert replog.dict["platform"] == sys.platform
+ assert replog.dict["host"] == py.std.socket.getfqdn()
+ data = replog.dumps_json()
+ replog2 = ResultLog.loads_json(data)
+ assert replog2.dict == replog.dict
+
def test_set_header(pkg):
replog = ResultLog()
d = replog.dict
diff --git a/tests/test_venv.py b/tests/test_venv.py
index b1d1f2e..3faa16b 100644
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -55,7 +55,7 @@ def test_create(monkeypatch, mocksession, newconfig):
l = mocksession._pcalls
assert len(l) >= 1
args = l[0].args
- assert "virtualenv" in str(args[1])
+ assert "virtualenv" == str(args[2])
if sys.platform != "win32":
# realpath is needed for stuff like the debian symlinks
assert py.path.local(sys.executable).realpath() \
@@ -211,6 +211,25 @@ def test_install_deps_indexserver(newmocksession):
assert "-i ABC" in args
assert "dep3" in args
+def test_install_deps_pre(newmocksession):
+ mocksession = newmocksession([], """
+ [testenv]
+ pip_pre=true
+ deps=
+ dep1
+ """)
+ venv = mocksession.getenv('python')
+ venv.create()
+ l = mocksession._pcalls
+ assert len(l) == 1
+ l[:] = []
+
+ venv.install_deps()
+ assert len(l) == 1
+ args = " ".join(l[0].args)
+ assert "--pre " in args
+ assert "dep1" in args
+
def test_installpkg_indexserver(newmocksession, tmpdir):
mocksession = newmocksession([], """
[tox]
@@ -328,7 +347,7 @@ def test_install_python3(tmpdir, newmocksession):
l = mocksession._pcalls
assert len(l) == 1
args = l[0].args
- assert str(args[1]).endswith('virtualenv')
+ assert str(args[2]) == 'virtualenv'
l[:] = []
action = mocksession.newaction(venv, "hello")
venv._install(["hello"], action=action)
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index 283c993..0c145be 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -200,7 +200,7 @@ def test_run_custom_install_command_error(cmd, initproj):
})
result = cmd.run("tox")
result.stdout.fnmatch_lines([
- "ERROR: invocation failed, args: ['*/tox.ini*",
+ "ERROR: invocation failed (errno *), args: ['*/tox.ini*",
])
assert result.ret
@@ -598,7 +598,7 @@ def test_sdistonly(initproj, cmd):
def test_separate_sdist_no_sdistfile(cmd, initproj):
distshare = cmd.tmpdir.join("distshare")
- initproj("pkg123-0.7", filedefs={
+ initproj(("pkg123-foo", "0.7"), filedefs={
'tox.ini': """
[tox]
distshare=%s
@@ -609,7 +609,7 @@ def test_separate_sdist_no_sdistfile(cmd, initproj):
l = distshare.listdir()
assert len(l) == 1
sdistfile = l[0]
- assert 'pkg123-0.7.zip' in str(sdistfile)
+ assert 'pkg123-foo-0.7.zip' in str(sdistfile)
def test_separate_sdist(cmd, initproj):
distshare = cmd.tmpdir.join("distshare")
diff --git a/tox.egg-info/PKG-INFO b/tox.egg-info/PKG-INFO
index ab41d25..e411bc0 100644
--- a/tox.egg-info/PKG-INFO
+++ b/tox.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tox
-Version: 1.8.0
+Version: 1.9.2
Summary: virtualenv-based automation of test activities
Home-page: http://tox.testrun.org/
Author: holger krekel
diff --git a/tox.egg-info/SOURCES.txt b/tox.egg-info/SOURCES.txt
index c0ad5fc..9f8934d 100644
--- a/tox.egg-info/SOURCES.txt
+++ b/tox.egg-info/SOURCES.txt
@@ -29,6 +29,7 @@ doc/announce/release-1.3.txt
doc/announce/release-1.4.3.txt
doc/announce/release-1.4.txt
doc/announce/release-1.8.txt
+doc/announce/release-1.9.txt
doc/example/basic.txt
doc/example/devenv.txt
doc/example/general.txt
diff --git a/tox.ini b/tox.ini
index 6bcca5e..97a1ac1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist=py27,py26,py34,py33,py32,pypy,flakes
+envlist=py27,py26,py34,py33,pypy,flakes
[testenv:X]
commands=echo {posargs}
@@ -14,7 +14,7 @@ changedir=doc
deps=sphinx
{[testenv]deps}
commands=
- py.test -v \
+ py.test -v
--junitxml={envlogdir}/junit-{envname}.xml \
check_sphinx.py {posargs}
@@ -22,9 +22,6 @@ commands=
deps = pytest-flakes>=0.2
commands = py.test --flakes -m flakes tox tests
-[testenv:py25]
-setenv= PIP_INSECURE=1
-
[pytest]
rsyncdirs=tests tox
addopts = -rsxXf
diff --git a/tox/__init__.py b/tox/__init__.py
index 3ce3574..2cc85ab 100644
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -1,5 +1,5 @@
#
-__version__ = '1.8.0'
+__version__ = '1.9.2'
class exception:
class Error(Exception):
diff --git a/tox/_cmdline.py b/tox/_cmdline.py
index aed71ec..14eb685 100644
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -78,26 +78,29 @@ class Action(object):
f.flush()
return f
- def popen(self, args, cwd=None, env=None, redirect=True, returnout=False):
- f = outpath = None
+ def popen(self, args, cwd=None, env=None, redirect=True, returnout=False, ignore_ret=False):
+ stdout = outpath = None
resultjson = self.session.config.option.resultjson
if resultjson or redirect:
- f = self._initlogpath(self.id)
- f.write("actionid=%s\nmsg=%s\ncmdargs=%r\nenv=%s\n" %(
+ fout = self._initlogpath(self.id)
+ fout.write("actionid=%s\nmsg=%s\ncmdargs=%r\nenv=%s\n" %(
self.id, self.msg, args, env))
- f.flush()
- self.popen_outpath = outpath = py.path.local(f.name)
+ fout.flush()
+ self.popen_outpath = outpath = py.path.local(fout.name)
+ fin = outpath.open()
+ fin.read() # read the header, so it won't be written to stdout
+ stdout = fout
elif returnout:
- f = subprocess.PIPE
+ stdout = subprocess.PIPE
if cwd is None:
# XXX cwd = self.session.config.cwd
cwd = py.path.local()
try:
popen = self._popen(args, cwd, env=env,
- stdout=f, stderr=STDOUT)
- except OSError:
- self.report.error("invocation failed, args: %s, cwd: %s" %
- (args, cwd))
+ stdout=stdout, stderr=STDOUT)
+ except OSError as e:
+ self.report.error("invocation failed (errno %d), args: %s, cwd: %s" %
+ (e.errno, args, cwd))
raise
popen.outpath = outpath
popen.args = [str(x) for x in args]
@@ -107,7 +110,33 @@ class Action(object):
try:
self.report.logpopen(popen, env=env)
try:
- out, err = popen.communicate()
+ if resultjson and not redirect:
+ assert popen.stderr is None # prevent deadlock
+ out = None
+ last_time = now()
+ while 1:
+ fin_pos = fin.tell()
+ # we have to read one byte at a time, otherwise there
+ # might be no output for a long time with slow tests
+ data = fin.read(1)
+ if data:
+ sys.stdout.write(data)
+ if '\n' in data or (now() - last_time) > 1:
+ # we flush on newlines or after 1 second to
+ # provide quick enough feedback to the user
+ # when printing a dot per test
+ sys.stdout.flush()
+ last_time = now()
+ elif popen.poll() is not None:
+ if popen.stdout is not None:
+ popen.stdout.close()
+ break
+ else:
+ py.std.time.sleep(0.1)
+ fin.seek(fin_pos)
+ fin.close()
+ else:
+ out, err = popen.communicate()
except KeyboardInterrupt:
self.report.keyboard_interrupt()
popen.wait()
@@ -115,11 +144,11 @@ class Action(object):
ret = popen.wait()
finally:
self._popenlist.remove(popen)
- if ret:
+ if ret and not ignore_ret:
invoked = " ".join(map(str, popen.args))
if outpath:
- self.report.error("invocation failed, logfile: %s" %
- outpath)
+ self.report.error("invocation failed (exit code %d), logfile: %s" %
+ (ret, outpath))
out = outpath.read()
self.report.error(out)
if hasattr(self, "commandlog"):
@@ -448,7 +477,7 @@ class Session:
if self.setupenv(venv):
if venv.envconfig.develop:
self.developpkg(venv, self.config.setupdir)
- elif self.config.skipsdist:
+ elif self.config.skipsdist or venv.envconfig.skip_install:
self.finishvenv(venv)
else:
self.installpkg(venv, sdist_path)
diff --git a/tox/_config.py b/tox/_config.py
index d0f8c3e..3d26686 100644
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -18,7 +18,7 @@ iswin32 = sys.platform == "win32"
default_factors = {'jython': 'jython', 'pypy': 'pypy', 'pypy3': 'pypy3',
'py': sys.executable}
-for version in '24,25,26,27,30,31,32,33,34'.split(','):
+for version in '24,25,26,27,30,31,32,33,34,35'.split(','):
default_factors['py' + version] = 'python%s.%s' % tuple(version)
def parseconfig(args=None, pkg=None):
@@ -105,6 +105,9 @@ def prepare_parse(pkgname):
dest="indexurl", metavar="URL",
help="set indexserver url (if URL is of form name=url set the "
"url for the 'name' indexserver, specifically)")
+ parser.add_argument("--pre", action="store_true", dest="pre",
+ help="install pre-releases and development versions of dependencies. "
+ "This will pass the --pre option to install_command (pip by default).")
parser.add_argument("-r", "--recreate", action="store_true",
dest="recreate",
help="force recreation of virtual environments")
@@ -284,10 +287,18 @@ class parseini:
config.envlist, all_envs = self._getenvdata(reader, toxsection)
- # configure testenvs
+ # factors used in config or predefined
known_factors = self._list_section_factors("testenv")
known_factors.update(default_factors)
known_factors.add("python")
+
+ # factors stated in config envlist
+ stated_envlist = reader.getdefault(toxsection, "envlist", replace=False)
+ if stated_envlist:
+ for env in _split_env(stated_envlist):
+ known_factors.update(env.split('-'))
+
+ # configure testenvs
for name in all_envs:
section = testenvprefix + name
factors = set(name.split('-'))
@@ -305,7 +316,7 @@ class parseini:
... 226 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/tox.git
More information about the Python-modules-commits
mailing list