diff options
author | holger krekel <holger@merlinux.eu> | 2014-06-18 12:07:35 +0200 |
---|---|---|
committer | holger krekel <holger@merlinux.eu> | 2014-06-18 12:07:35 +0200 |
commit | a806881459a7b33dcee496ac079e172b3d2ccbc0 (patch) | |
tree | 92112c97d718b5635087f388b7ca727a9782b544 | |
parent | 821ec92c19d5ef356947252819b9232288c0b9c2 (diff) | |
parent | 82bc07071e538b45156ce2baecf747f639559740 (diff) | |
download | tox-a806881459a7b33dcee496ac079e172b3d2ccbc0.tar.gz |
Merged in yunake/tox/missing_interpreter_config_option (pull request #111)
Add support for setting skip_missing_interpreters as a config option and not just a command line flag
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | doc/config.txt | 12 | ||||
-rw-r--r-- | tests/test_config.py | 16 | ||||
-rw-r--r-- | tox/_config.py | 4 |
5 files changed, 35 insertions, 1 deletions
@@ -7,7 +7,8 @@ development resulting in a more refined behaviour in the 1.8 series. And thanks to Clark Boylan for the PR. -- fix issue59: add option "--skip-missing-interpreters" which won't fail the +- fix issue59: add a config variable ``skip-missing-interpreters`` as well as + command line option ``--skip-missing-interpreters`` which won't fail the build if Python interpreters listed in tox.ini are missing. Thanks Alexandre Conrad for PR104. diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 25c7788..d10950b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -27,3 +27,4 @@ Alexandre Conrad Morgan Fainberg Marc Schlaich Clark Boylan +Eugene Yunak diff --git a/doc/config.txt b/doc/config.txt index a6ca4c8..23bf128 100644 --- a/doc/config.txt +++ b/doc/config.txt @@ -32,6 +32,18 @@ and will first lookup global tox settings in this section:: ... # override [tox] settings for the jenkins context # note: for jenkins distshare defaults to ``{toxworkdir}/distshare``. +.. confval:: skip_missing_interpreters=BOOL + + .. versionadded:: 1.7.2 + + Setting this to ``True`` is equivalent of passing the + ``--skip-missing-interpreters`` command line option, and will force ``tox`` to + return success even if some of the specified environments were missing. This is + useful for some CI systems or running on a developer box, where you might only + have a subset of all your supported interpreters installed but don't want to + mark the build as failed because of it. As expected, the command line switch + always overrides this setting if passed on the invokation. + **Default:** ``False`` envlist setting +++++++++++++++ diff --git a/tests/test_config.py b/tests/test_config.py index c55f43a..ff743c4 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -943,6 +943,22 @@ class TestGlobalOptions: config = newconfig([], inisource) assert config.minversion == "3.0" + def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = True + """ + config = newconfig([], inisource) + assert config.option.skip_missing_interpreters + + def test_skip_missing_interpreters_false(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = False + """ + config = newconfig([], inisource) + assert not config.option.skip_missing_interpreters + def test_defaultenv_commandline(self, tmpdir, newconfig, monkeypatch): config = newconfig(["-epy24"], "") env = config.envconfigs['py24'] diff --git a/tox/_config.py b/tox/_config.py index 0a9dc1a..4f89d00 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -239,6 +239,10 @@ class parseini: "{toxinidir}/.tox") config.minversion = reader.getdefault(toxsection, "minversion", None) + if not config.option.skip_missing_interpreters: + config.option.skip_missing_interpreters = \ + reader.getbool(toxsection, "skip_missing_interpreters", False) + # determine indexserver dictionary config.indexserver = {'default': IndexServerConfig('default')} prefix = "indexserver" |