diff options
author | Eugene Yunak <eugene@yunak.eu> | 2014-06-18 12:09:13 +0300 |
---|---|---|
committer | Eugene Yunak <eugene@yunak.eu> | 2014-06-18 12:09:13 +0300 |
commit | 37947b687b27bd8e0a8921d22502629b240c6ecb (patch) | |
tree | 07ff68a52330574c116513c8f96b96fd10edc878 | |
parent | 821ec92c19d5ef356947252819b9232288c0b9c2 (diff) | |
download | tox-37947b687b27bd8e0a8921d22502629b240c6ecb.tar.gz |
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 | 7 | ||||
-rw-r--r-- | tests/test_config.py | 8 | ||||
-rw-r--r-- | tox/_config.py | 4 |
5 files changed, 22 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..fd7f79f 100644 --- a/doc/config.txt +++ b/doc/config.txt @@ -22,6 +22,7 @@ List of optional global options:: distshare=path # defaults to {homedir}/.tox/distshare envlist=ENVLIST # defaults to the list of all environments skipsdist=BOOL # defaults to false + skip_missing_interpreters=BOOL # defaults to false ``tox`` autodetects if it is running in a Jenkins_ context @@ -32,6 +33,12 @@ 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``. +Setting ``skip_missing_interpreters`` 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. envlist setting +++++++++++++++ diff --git a/tests/test_config.py b/tests/test_config.py index c55f43a..86f93e7 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -943,6 +943,14 @@ class TestGlobalOptions: config = newconfig([], inisource) assert config.minversion == "3.0" + def test_skip_missing_interpreters(self, tmpdir, newconfig, monkeypatch): + inisource = """ + [tox] + skip_missing_interpreters = True + """ + config = newconfig([], inisource) + assert 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..45d626a 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.getdefault(toxsection, "skip_missing_interpreters", None) + # determine indexserver dictionary config.indexserver = {'default': IndexServerConfig('default')} prefix = "indexserver" |