From 1806b1fb9e101511c6e055b57b53509a0231ccf5 Mon Sep 17 00:00:00 2001 From: Ollie Walsh Date: Fri, 3 Jul 2015 16:53:51 +0100 Subject: Reorder the processing of testenv options. Fixes issue #246 --- tests/test_config.py | 12 ++++++++++++ tox/config.py | 27 +++++++++++++-------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 8aa7abd..8f5f4c5 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -926,6 +926,18 @@ class TestConfigTestEnv: assert argv[7][0] == config.homedir.join(".tox", "distshare") assert argv[8][0] == conf.envlogdir + def test_substitution_notfound_issue246(tmpdir, newconfig): + config = newconfig(""" + [testenv:py27] + setenv = + FOO={envbindir} + BAR={envsitepackagesdir} + """) + conf = config.envconfigs['py27'] + env = conf.setenv + assert 'FOO' in env + assert 'BAR' in env + def test_substitution_positional(self, newconfig): inisource = """ [testenv:py27] diff --git a/tox/config.py b/tox/config.py index 092de2a..d23d690 100644 --- a/tox/config.py +++ b/tox/config.py @@ -320,6 +320,18 @@ def tox_addoption(parser): help="additional arguments available to command positional substitution") # add various core venv interpreter attributes + def basepython_default(testenv_config, value): + if value is None: + for f in testenv_config.factors: + if f in default_factors: + return default_factors[f] + return sys.executable + return str(value) + + parser.add_testenv_attribute( + name="basepython", type="string", default=None, postprocess=basepython_default, + help="executable name or path of interpreter used to create a " + "virtual test environment.") parser.add_testenv_attribute( name="envdir", type="path", default="{toxworkdir}/{envname}", @@ -453,19 +465,6 @@ def tox_addoption(parser): name="usedevelop", type="bool", postprocess=develop, default=False, help="install package in develop/editable mode") - def basepython_default(testenv_config, value): - if value is None: - for f in testenv_config.factors: - if f in default_factors: - return default_factors[f] - return sys.executable - return str(value) - - parser.add_testenv_attribute( - name="basepython", type="string", default=None, postprocess=basepython_default, - help="executable name or path of interpreter used to create a " - "virtual test environment.") - parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute_obj(DepOption()) @@ -709,7 +708,7 @@ class parseini: if atype == "path": reader.addsubstitutions(**{env_attr.name: res}) - if env_attr.name == "install_command": + if env_attr.name == "envdir": reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython, envsitepackagesdir=vc.envsitepackagesdir) return vc -- cgit v1.2.1 From 238dd2fcf52d87194815a34f14671fa0d26827c6 Mon Sep 17 00:00:00 2001 From: Ollie Walsh Date: Fri, 3 Jul 2015 17:02:27 +0100 Subject: Cleanup flakes --- tests/test_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 8f5f4c5..06f8d36 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -926,11 +926,11 @@ class TestConfigTestEnv: assert argv[7][0] == config.homedir.join(".tox", "distshare") assert argv[8][0] == conf.envlogdir - def test_substitution_notfound_issue246(tmpdir, newconfig): + def test_substitution_notfound_issue246(tmpdir, newconfig): config = newconfig(""" [testenv:py27] - setenv = - FOO={envbindir} + setenv = + FOO={envbindir} BAR={envsitepackagesdir} """) conf = config.envconfigs['py27'] -- cgit v1.2.1 From a2a7dc740529b250384753b27b4b286eb51a4850 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 29 Oct 2015 14:55:56 +0100 Subject: add changelog --- CHANGELOG | 7 +++++++ doc/example/pytest.txt | 0 setup.py | 2 +- tox/__init__.py | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) mode change 100755 => 100644 doc/example/pytest.txt diff --git a/CHANGELOG b/CHANGELOG index 54ea8be..5370095 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +2.1.2 (dev) +----------- + +- fix issue265 and add LD_LIBRARY_PATH to passenv on linux by default + because otherwise the python interpreter might not start up in + certain configurations (redhat software collections). Thanks David Riddle. + 2.1.1 ---------- diff --git a/doc/example/pytest.txt b/doc/example/pytest.txt old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py index a72a5fc..db09786 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ def main(): description='virtualenv-based automation of test activities', long_description=open("README.rst").read(), url='http://tox.testrun.org/', - version='2.1.1', + version='2.1.2.dev1', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff --git a/tox/__init__.py b/tox/__init__.py index b2fed05..c4f8107 100644 --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '2.1.1' +__version__ = '2.1.2.dev1' from .hookspecs import hookspec, hookimpl # noqa -- cgit v1.2.1 From bec8532fcc03ed2303e8fce91357eaad1a845096 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 29 Oct 2015 17:28:02 +0100 Subject: mention of fix issue246: fix regression in config parsing by reordering such that {envbindir} can be used again in tox.ini. Thanks Olli Walsh. --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5370095..2a9be6d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,10 @@ because otherwise the python interpreter might not start up in certain configurations (redhat software collections). Thanks David Riddle. +- fix issue246: fix regression in config parsing by reordering + such that {envbindir} can be used again in tox.ini. Thanks Olli Walsh. + + 2.1.1 ---------- -- cgit v1.2.1