commit python3-tox for openSUSE:Factory
Hello community, here is the log from the commit of package python3-tox for openSUSE:Factory checked in at 2015-02-27 10:59:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-tox (Old) and /work/SRC/openSUSE:Factory/.python3-tox.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-tox" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-tox/python3-tox.changes 2015-02-16 22:25:07.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-tox.new/python3-tox.changes 2015-02-27 11:00:31.000000000 +0100 @@ -1,0 +2,20 @@ +Thu Feb 26 02:58:07 UTC 2015 - arun@gmx.de + +- update to version 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 + +------------------------------------------------------------------- Old: ---- tox-1.8.1.tar.gz New: ---- tox-1.9.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-tox.spec ++++++ --- /var/tmp/diff_new_pack.klVcNa/_old 2015-02-27 11:00:32.000000000 +0100 +++ /var/tmp/diff_new_pack.klVcNa/_new 2015-02-27 11:00:32.000000000 +0100 @@ -17,7 +17,7 @@ Name: python3-tox -Version: 1.8.1 +Version: 1.9.0 Release: 0 Summary: Virtualenv-based automation of test activities License: MIT ++++++ tox-1.8.1.tar.gz -> tox-1.9.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/CHANGELOG new/tox-1.9.0/CHANGELOG --- old/tox-1.8.1/CHANGELOG 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/CHANGELOG 2015-02-24 16:20:48.000000000 +0100 @@ -1,4 +1,29 @@ -1.8.1.dev +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. @@ -11,7 +36,6 @@ - report subprocess exit code when execution fails. Thanks Marius Gedminas. - 1.8.0 ----------- @@ -83,7 +107,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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/CONTRIBUTORS new/tox-1.9.0/CONTRIBUTORS --- old/tox-1.8.1/CONTRIBUTORS 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/CONTRIBUTORS 2015-02-24 16:20:48.000000000 +0100 @@ -24,8 +24,10 @@ Mattieu Agopian Asmund Grammeltwedt Ionel Maries Cristian +Julian Krause Alexandre Conrad Morgan Fainberg Marc Schlaich Clark Boylan Eugene Yunak +Mark Hirota diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/PKG-INFO new/tox-1.9.0/PKG-INFO --- old/tox-1.8.1/PKG-INFO 2014-10-24 14:58:39.000000000 +0200 +++ new/tox-1.9.0/PKG-INFO 2015-02-24 16:20:48.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: tox -Version: 1.8.1 +Version: 1.9.0 Summary: virtualenv-based automation of test activities Home-page: http://tox.testrun.org/ Author: holger krekel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/doc/announce/release-1.9.txt new/tox-1.9.0/doc/announce/release-1.9.txt --- old/tox-1.8.1/doc/announce/release-1.9.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/tox-1.9.0/doc/announce/release-1.9.txt 2015-02-24 16:20:48.000000000 +0100 @@ -0,0 +1,59 @@ +tox 1.9: refinements, fixes +============================================================================= + +This is a maintenance release of tox with a few backward-compatible +enhancements. 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/doc/conf.py new/tox-1.9.0/doc/conf.py --- old/tox-1.8.1/doc/conf.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/doc/conf.py 2015-02-24 16:20:48.000000000 +0100 @@ -48,8 +48,8 @@ # 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/doc/config.txt new/tox-1.9.0/doc/config.txt --- old/tox-1.8.1/doc/config.txt 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/doc/config.txt 2015-02-24 16:20:48.000000000 +0100 @@ -86,6 +86,8 @@ 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 @@ **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 @@ **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 ------------- @@ -422,6 +449,8 @@ Let's go through this step by step. +.. _generative-envlist: + Generative envlist +++++++++++++++++++++++ @@ -455,6 +484,8 @@ flake +.. _factors: + Factors and factor-conditional settings ++++++++++++++++++++++++++++++++++++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/doc/example/basic.txt new/tox-1.9.0/doc/example/basic.txt --- old/tox-1.8.1/doc/example/basic.txt 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/doc/example/basic.txt 2015-02-24 16:20:48.000000000 +0100 @@ -74,9 +74,9 @@ (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 @@ 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 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/setup.py new/tox-1.9.0/setup.py --- old/tox-1.8.1/setup.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/setup.py 2015-02-24 16:20:48.000000000 +0100 @@ -26,7 +26,7 @@ description='virtualenv-based automation of test activities', long_description=open("README.rst").read(), url='http://tox.testrun.org/', - version='1.8.1', + version='1.9.0', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tests/test_config.py new/tox-1.9.0/tests/test_config.py --- old/tox-1.8.1/tests/test_config.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tests/test_config.py 2015-02-24 16:20:48.000000000 +0100 @@ -106,6 +106,7 @@ 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 @@ 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 @@ '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(""" @@ -927,6 +960,31 @@ 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] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tests/test_quickstart.py new/tox-1.9.0/tests/test_quickstart.py --- old/tox-1.8.1/tests/test_quickstart.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tests/test_quickstart.py 2015-02-24 16:20:48.000000000 +0100 @@ -37,6 +37,7 @@ 'Y', # py32 'Y', # py33 'Y', # py34 + 'Y', # py35 'Y', # pypy 'N', # jython 'py.test', # command to run tests @@ -54,7 +55,7 @@ # 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 @@ 'Y', # py32 'Y', # py33 'Y', # py34 + 'Y', # py35 'Y', # pypy 'N', # jython 'nosetests', # command to run tests @@ -94,7 +96,7 @@ # 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 @@ 'Y', # py32 'Y', # py33 'Y', # py34 + 'Y', # py35 'Y', # pypy 'N', # jython 'trial', # command to run tests @@ -134,7 +137,7 @@ # 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 @@ 'Y', # py32 'Y', # py33 'Y', # py34 + 'Y', # py35 'Y', # pypy 'N', # jython 'py.test', # command to run tests @@ -173,7 +177,7 @@ # 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 @@ # 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 @@ '', # py32 '', # py33 '', # py34 + '', # py35 '', # pypy '', # jython '', # command to run tests @@ -312,7 +317,7 @@ # 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 @@ '', # py32 '', # py33 '', # py34 + '', # py35 '', # pypy '', # jython '', # command to run tests @@ -357,7 +363,7 @@ # 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 @@ 'py32': True, 'py33': True, 'py34': True, + 'py35': True, 'pypy': True, 'commands': 'nosetests -v', 'deps': 'nose', @@ -470,7 +477,7 @@ # 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tests/test_result.py new/tox-1.9.0/tests/test_result.py --- old/tox-1.8.1/tests/test_result.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tests/test_result.py 2015-02-24 16:20:48.000000000 +0100 @@ -10,6 +10,18 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tests/test_venv.py new/tox-1.9.0/tests/test_venv.py --- old/tox-1.8.1/tests/test_venv.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tests/test_venv.py 2015-02-24 16:20:48.000000000 +0100 @@ -211,6 +211,25 @@ 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] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox/__init__.py new/tox-1.9.0/tox/__init__.py --- old/tox-1.8.1/tox/__init__.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tox/__init__.py 2015-02-24 16:20:48.000000000 +0100 @@ -1,5 +1,5 @@ # -__version__ = '1.8.1' +__version__ = '1.9.0' class exception: class Error(Exception): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox/_cmdline.py new/tox-1.9.0/tox/_cmdline.py --- old/tox-1.8.1/tox/_cmdline.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tox/_cmdline.py 2015-02-24 16:20:48.000000000 +0100 @@ -11,6 +11,7 @@ import os import sys import subprocess +import time from tox._verlib import NormalizedVersion, IrrationalVersionError from tox._venv import VirtualEnv from tox._config import parseconfig @@ -78,8 +79,8 @@ 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) @@ -87,14 +88,18 @@ self.id, self.msg, args, env)) f.flush() self.popen_outpath = outpath = py.path.local(f.name) + if resultjson: + stdout = subprocess.PIPE + else: + stdout = f 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) + stdout=stdout, stderr=STDOUT) except OSError as e: self.report.error("invocation failed (errno %d), args: %s, cwd: %s" % (e.errno, args, cwd)) @@ -107,7 +112,28 @@ 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 = time.time() + while 1: + # we have to read one byte at a time, otherwise there + # might be no output for a long time with slow tests + data = popen.stdout.read(1) + if data: + sys.stdout.write(data) + if '\n' in data or (time.time() - last_time) > 5: + # we flush on newlines or after 5 seconds to + # provide quick enough feedback to the user + # when printing a dot per test + sys.stdout.flush() + last_time = time.time() + f.write(data) + elif popen.poll() is not None: + popen.stdout.close() + break + else: + out, err = popen.communicate() except KeyboardInterrupt: self.report.keyboard_interrupt() popen.wait() @@ -115,7 +141,7 @@ 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 (exit code %d), logfile: %s" % @@ -448,7 +474,7 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox/_config.py new/tox-1.9.0/tox/_config.py --- old/tox-1.8.1/tox/_config.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tox/_config.py 2015-02-24 16:20:48.000000000 +0100 @@ -18,7 +18,7 @@ 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 @@ 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 @@ 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('-')) @@ -381,15 +392,19 @@ downloadcache = os.environ.get("PIP_DOWNLOAD_CACHE", downloadcache) vc.downloadcache = py.path.local(downloadcache) - pip_default_opts = ["--pre", "{opts}", "{packages}"] vc.install_command = reader.getargv( section, "install_command", - "pip install " + " ".join(pip_default_opts), + "pip install {opts} {packages}", ) if '{packages}' not in vc.install_command: raise tox.exception.ConfigError( "'install_command' must contain '{packages}' substitution") + vc.pip_pre = config.option.pre or reader.getbool( + section, "pip_pre", False) + + vc.skip_install = reader.getbool(section, "skip_install", False) + return vc def _getenvdata(self, reader, toxsection): @@ -451,7 +466,7 @@ def _expand_envstr(envstr): # split by commas not in groups - tokens = re.split(r'(\{[^}]+\})|,', envstr) + tokens = re.split(r'((?:\{[^}]+\})+)|,', envstr) envlist = [''.join(g).strip() for k, g in itertools.groupby(tokens, key=bool) if k] @@ -797,7 +812,7 @@ return ps.yield_words def getcontextname(): - if 'HUDSON_URL' in os.environ: + if any(env in os.environ for env in ['JENKINS_URL', 'HUDSON_URL']): return 'jenkins' return None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox/_quickstart.py new/tox-1.9.0/tox/_quickstart.py --- old/tox-1.8.1/tox/_quickstart.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tox/_quickstart.py 2015-02-24 16:20:48.000000000 +0100 @@ -56,7 +56,7 @@ term_input = input -all_envs = ['py26', 'py27', 'py32', 'py33', 'py34', 'pypy', 'jython'] +all_envs = ['py26', 'py27', 'py32', 'py33', 'py34', 'py35', 'pypy', 'jython'] PROMPT_PREFIX = '> ' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox/_venv.py new/tox-1.9.0/tox/_venv.py --- old/tox-1.8.1/tox/_venv.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tox/_venv.py 2015-02-24 16:20:48.000000000 +0100 @@ -260,6 +260,8 @@ if self.envconfig.downloadcache: self.envconfig.downloadcache.ensure(dir=1) l.append("--download-cache=%s" % self.envconfig.downloadcache) + if self.envconfig.pip_pre: + l.append("--pre") return l def run_install_command(self, packages, options=(), @@ -343,8 +345,19 @@ message = "commands[%s] | %s" % (i, ' '.join( [str(x) for x in argv])) action.setactivity("runtests", message) + # check to see if we need to ignore the return code + # if so, we need to alter the command line arguments + if argv[0].startswith("-"): + ignore_ret = True + if argv[0] == "-": + del argv[0] + else: + argv[0] = argv[0].lstrip("-") + else: + ignore_ret = False + try: - self._pcall(argv, cwd=cwd, action=action, redirect=redirect) + self._pcall(argv, cwd=cwd, action=action, redirect=redirect, ignore_ret=ignore_ret) except tox.exception.InvocationError: val = sys.exc_info()[1] self.session.report.error(str(val)) @@ -355,7 +368,7 @@ raise def _pcall(self, args, venv=True, cwd=None, extraenv={}, - action=None, redirect=True): + action=None, redirect=True, ignore_ret=False): for name in ("VIRTUALENV_PYTHON", "PYTHONDONTWRITEBYTECODE"): try: del os.environ[name] @@ -367,7 +380,7 @@ try: args[0] = self.getcommandpath(args[0], venv, cwd) env = self._getenv(extraenv) - return action.popen(args, cwd=cwd, env=env, redirect=redirect) + return action.popen(args, cwd=cwd, env=env, redirect=redirect, ignore_ret=ignore_ret) finally: os.environ['PATH'] = old diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox/result.py new/tox-1.9.0/tox/result.py --- old/tox-1.8.1/tox/result.py 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tox/result.py 2015-02-24 16:20:48.000000000 +0100 @@ -1,9 +1,7 @@ import sys import py -try: - import json -except ImportError: - import simplejson as json +from tox import __version__ as toxver +import json class ResultLog: @@ -11,12 +9,11 @@ if dict is None: dict = {} self.dict = dict - - def set_header(self, installpkg): - from tox import __version__ as toxver self.dict.update({"reportversion": "1", "toxversion": toxver}) self.dict["platform"] = sys.platform self.dict["host"] = py.std.socket.getfqdn() + + def set_header(self, installpkg): self.dict["installpkg"] = dict( md5=installpkg.computehash("md5"), sha256=installpkg.computehash("sha256"), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox.egg-info/PKG-INFO new/tox-1.9.0/tox.egg-info/PKG-INFO --- old/tox-1.8.1/tox.egg-info/PKG-INFO 2014-10-24 14:58:39.000000000 +0200 +++ new/tox-1.9.0/tox.egg-info/PKG-INFO 2015-02-24 16:20:48.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: tox -Version: 1.8.1 +Version: 1.9.0 Summary: virtualenv-based automation of test activities Home-page: http://tox.testrun.org/ Author: holger krekel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox.egg-info/SOURCES.txt new/tox-1.9.0/tox.egg-info/SOURCES.txt --- old/tox-1.8.1/tox.egg-info/SOURCES.txt 2014-10-24 14:58:39.000000000 +0200 +++ new/tox-1.9.0/tox.egg-info/SOURCES.txt 2015-02-24 16:20:48.000000000 +0100 @@ -29,6 +29,7 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tox-1.8.1/tox.ini new/tox-1.9.0/tox.ini --- old/tox-1.8.1/tox.ini 2014-10-24 14:58:38.000000000 +0200 +++ new/tox-1.9.0/tox.ini 2015-02-24 16:20:48.000000000 +0100 @@ -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 @@ deps=sphinx {[testenv]deps} commands= - py.test -v \ + py.test -v --junitxml={envlogdir}/junit-{envname}.xml \ check_sphinx.py {posargs} @@ -22,9 +22,6 @@ 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 -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de