Hello community,

here is the log from the commit of package python3-tox for openSUSE:Factory 
checked in at 2015-12-23 09:57:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-12-18 
21:51:36.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-tox.new/python3-tox.changes     
2015-12-23 09:57:13.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Dec 21 19:22:22 UTC 2015 - [email protected]
+
+- update to version 2.3.1:
+  * fix issue294: re-allow cross-section substitution for setenv.
+
+-------------------------------------------------------------------

Old:
----
  tox-2.3.0.tar.gz

New:
----
  tox-2.3.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-tox.spec ++++++
--- /var/tmp/diff_new_pack.ez2MT9/_old  2015-12-23 09:57:14.000000000 +0100
+++ /var/tmp/diff_new_pack.ez2MT9/_new  2015-12-23 09:57:14.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           python3-tox
-Version:        2.3.0
+Version:        2.3.1
 Release:        0
 Summary:        Virtualenv-based automation of test activities
 License:        MIT

++++++ tox-2.3.0.tar.gz -> tox-2.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tox-2.3.0/CHANGELOG new/tox-2.3.1/CHANGELOG
--- old/tox-2.3.0/CHANGELOG     2015-12-09 13:38:11.000000000 +0100
+++ new/tox-2.3.1/CHANGELOG     2015-12-14 11:03:29.000000000 +0100
@@ -1,3 +1,8 @@
+2.3.1
+-----
+
+- fix issue294: re-allow cross-section substitution for setenv.
+
 2.3.0
 -----
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tox-2.3.0/PKG-INFO new/tox-2.3.1/PKG-INFO
--- old/tox-2.3.0/PKG-INFO      2015-12-09 13:38:12.000000000 +0100
+++ new/tox-2.3.1/PKG-INFO      2015-12-14 11:03:29.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tox
-Version: 2.3.0
+Version: 2.3.1
 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-2.3.0/setup.py new/tox-2.3.1/setup.py
--- old/tox-2.3.0/setup.py      2015-12-09 13:38:11.000000000 +0100
+++ new/tox-2.3.1/setup.py      2015-12-14 11:03:29.000000000 +0100
@@ -48,7 +48,7 @@
         description='virtualenv-based automation of test activities',
         long_description=open("README.rst").read(),
         url='http://tox.testrun.org/',
-        version='2.3.0',
+        version='2.3.1',
         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-2.3.0/tests/test_config.py 
new/tox-2.3.1/tests/test_config.py
--- old/tox-2.3.0/tests/test_config.py  2015-12-09 13:38:11.000000000 +0100
+++ new/tox-2.3.1/tests/test_config.py  2015-12-14 11:03:29.000000000 +0100
@@ -1672,8 +1672,7 @@
         assert envconfig.setenv['VAL'] == envconfig.envdir
         assert str(envconfig.envdir) in envconfig.commands[0]
 
-    @pytest.mark.xfail(reason="we don't implement cross-section substitution 
for setenv")
-    def test_setenv_cross_section_subst(self, monkeypatch, newconfig):
+    def test_setenv_cross_section_subst_issue294(self, monkeypatch, newconfig):
         """test that we can do cross-section substitution with setenv"""
         monkeypatch.delenv('TEST', raising=False)
         config = newconfig("""
@@ -1687,6 +1686,36 @@
         envconfig = config.envconfigs["python"]
         assert envconfig.setenv["NOT_TEST"] == "defaultvalue"
 
+    def test_setenv_cross_section_subst_twice(self, monkeypatch, newconfig):
+        """test that we can do cross-section substitution with setenv"""
+        monkeypatch.delenv('TEST', raising=False)
+        config = newconfig("""
+            [section]
+            x = NOT_TEST={env:TEST:defaultvalue}
+            [section1]
+            y = {[section]x}
+
+            [testenv]
+            setenv = {[section1]y}
+        """)
+        envconfig = config.envconfigs["python"]
+        assert envconfig.setenv["NOT_TEST"] == "defaultvalue"
+
+    def test_setenv_cross_section_mixed(self, monkeypatch, newconfig):
+        """test that we can do cross-section substitution with setenv"""
+        monkeypatch.delenv('TEST', raising=False)
+        config = newconfig("""
+            [section]
+            x = NOT_TEST={env:TEST:defaultvalue}
+
+            [testenv]
+            setenv = {[section]x}
+                     y = 7
+        """)
+        envconfig = config.envconfigs["python"]
+        assert envconfig.setenv["NOT_TEST"] == "defaultvalue"
+        assert envconfig.setenv["y"] == "7"
+
 
 class TestIndexServer:
     def test_indexserver(self, tmpdir, newconfig):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tox-2.3.0/tox/__init__.py 
new/tox-2.3.1/tox/__init__.py
--- old/tox-2.3.0/tox/__init__.py       2015-12-09 13:38:11.000000000 +0100
+++ new/tox-2.3.1/tox/__init__.py       2015-12-14 11:03:29.000000000 +0100
@@ -1,5 +1,5 @@
 #
-__version__ = '2.3.0'
+__version__ = '2.3.1'
 
 from .hookspecs import hookspec, hookimpl  # noqa
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tox-2.3.0/tox/config.py new/tox-2.3.1/tox/config.py
--- old/tox-2.3.0/tox/config.py 2015-12-09 13:38:11.000000000 +0100
+++ new/tox-2.3.1/tox/config.py 2015-12-14 11:03:29.000000000 +0100
@@ -889,7 +889,7 @@
         return self._getdict(value, default=default, sep=sep)
 
     def getdict_setenv(self, name, default=None, sep="\n"):
-        value = self.getstring(name, None, replace=False)
+        value = self.getstring(name, None, replace=True, crossonly=True)
         definitions = self._getdict(value, default=default, sep=sep)
         self._setenv = SetenvDict(definitions, reader=self)
         return self._setenv
@@ -931,7 +931,7 @@
     def getargv(self, name, default=""):
         return self.getargvlist(name, default)[0]
 
-    def getstring(self, name, default=None, replace=True):
+    def getstring(self, name, default=None, replace=True, crossonly=False):
         x = None
         for s in [self.section_name] + self.fallbacksections:
             try:
@@ -946,7 +946,7 @@
             x = self._apply_factors(x)
 
         if replace and x and hasattr(x, 'replace'):
-            x = self._replace(x, name=name)
+            x = self._replace(x, name=name, crossonly=crossonly)
         # print "getstring", self.section_name, name, "returned", repr(x)
         return x
 
@@ -963,14 +963,14 @@
         lines = s.strip().splitlines()
         return '\n'.join(filter(None, map(factor_line, lines)))
 
-    def _replace(self, value, name=None, section_name=None):
+    def _replace(self, value, name=None, section_name=None, crossonly=False):
         if '{' not in value:
             return value
 
         section_name = section_name if section_name else self.section_name
         self._subststack.append((section_name, name))
         try:
-            return Replacer(self).do_replace(value)
+            return Replacer(self, crossonly=crossonly).do_replace(value)
         finally:
             assert self._subststack.pop() == (section_name, name)
 
@@ -982,22 +982,28 @@
         (?:(?P<sub_type>[^[:{}]+):)?    # optional sub_type for special rules
         (?P<substitution_value>[^{}]*)  # substitution key
         [}]
-        ''',
-        re.VERBOSE)
+        ''', re.VERBOSE)
 
-    def __init__(self, reader):
+    def __init__(self, reader, crossonly=False):
         self.reader = reader
+        self.crossonly = crossonly
 
     def do_replace(self, x):
         return self.RE_ITEM_REF.sub(self._replace_match, x)
 
     def _replace_match(self, match):
         g = match.groupdict()
+        sub_value = g['substitution_value']
+        if self.crossonly:
+            if sub_value.startswith("["):
+                return self._substitute_from_other_section(sub_value)
+            # in crossonly we return all other hits verbatim
+            start, end = match.span()
+            return match.string[start:end]
 
         # special case: opts and packages. Leave {opts} and
         # {packages} intact, they are replaced manually in
         # _venv.VirtualEnv.run_install_command.
-        sub_value = g['substitution_value']
         if sub_value in ('opts', 'packages'):
             return '{%s}' % sub_value
 
@@ -1048,7 +1054,8 @@
                     raise ValueError('%s already in %s' % (
                         (section, item), self.reader._subststack))
                 x = str(cfg[section][item])
-                return self.reader._replace(x, name=item, section_name=section)
+                return self.reader._replace(x, name=item, section_name=section,
+                                            crossonly=self.crossonly)
 
         raise tox.exception.ConfigError(
             "substitution key %r not found" % key)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tox-2.3.0/tox.egg-info/PKG-INFO 
new/tox-2.3.1/tox.egg-info/PKG-INFO
--- old/tox-2.3.0/tox.egg-info/PKG-INFO 2015-12-09 13:38:12.000000000 +0100
+++ new/tox-2.3.1/tox.egg-info/PKG-INFO 2015-12-14 11:03:29.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tox
-Version: 2.3.0
+Version: 2.3.1
 Summary: virtualenv-based automation of test activities
 Home-page: http://tox.testrun.org/
 Author: holger krekel


Reply via email to