[Pytest-commit] commit/tox: 4 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Oct 10 11:03:20 CEST 2013


4 new commits in tox:

https://bitbucket.org/hpk42/tox/commits/1f451606af67/
Changeset:   1f451606af67
User:        evers
Date:        2013-10-09 23:20:42
Summary:     remove unused kwarg rexpattern from IniReader._replace
Affected #:  1 file

diff -r cfa57eaab6db525c3035d473ab308b729b73e24c -r 1f451606af676fc7dc93cafde8d4916954ac9d2b tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -621,14 +621,13 @@
     def _replace_match_no_quote(self, match):
         return self._replace_match(match, quote=False)
 
-    def _replace(self, x, rexpattern=RE_ITEM_REF, quote=False):
-        # XXX is rexpattern used by callers? can it be removed?
+    def _replace(self, x, quote=False):
         if '{' in x:
             if quote:
                 replace_func = self._replace_match_quote
             else:
                 replace_func = self._replace_match_no_quote
-            return rexpattern.sub(replace_func, x)
+            return RE_ITEM_REF.sub(replace_func, x)
         return x
 
     def _parse_command(self, command):


https://bitbucket.org/hpk42/tox/commits/bb2943b51122/
Changeset:   bb2943b51122
User:        evers
Date:        2013-10-10 00:04:16
Summary:     use substitution in install_command
Affected #:  2 files

diff -r 1f451606af676fc7dc93cafde8d4916954ac9d2b -r bb2943b51122e0fee77f9787d795965904881f7d tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -529,6 +529,15 @@
             install_command=pip install
         """)
 
+    def test_install_command_substitutions(self, newconfig):
+        config = newconfig("""
+            [testenv]
+            install_command=some_install {toxinidir} {envname} {packages}
+        """)
+        envconfig = config.envconfigs['python']
+        assert envconfig.install_command == [
+            'some_install', config.toxinidir, 'python', '{packages}']
+
     def test_downloadcache(self, newconfig, monkeypatch):
         monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False)
         config = newconfig("""

diff -r 1f451606af676fc7dc93cafde8d4916954ac9d2b -r bb2943b51122e0fee77f9787d795965904881f7d tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -341,7 +341,7 @@
             section,
             "install_command",
             "pip install " + " ".join(pip_default_opts),
-            replace=False,
+            replace=True,
             )
         if '{packages}' not in vc.install_command:
             raise tox.exception.ConfigError(
@@ -597,6 +597,13 @@
         if self._is_bare_posargs(g):
             return self._do_replace_posargs(lambda: '')
 
+        # 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
+
         handlers = {
             'posargs' : self._replace_posargs,
             'env' : self._replace_env,


https://bitbucket.org/hpk42/tox/commits/07a696f394d2/
Changeset:   07a696f394d2
User:        evers
Date:        2013-10-10 00:08:42
Summary:     remove replace kwarg in install_command handling, True is the default
Affected #:  1 file

diff -r bb2943b51122e0fee77f9787d795965904881f7d -r 07a696f394d27c0cefeef318092b3ecba76694ee tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -341,7 +341,6 @@
             section,
             "install_command",
             "pip install " + " ".join(pip_default_opts),
-            replace=True,
             )
         if '{packages}' not in vc.install_command:
             raise tox.exception.ConfigError(


https://bitbucket.org/hpk42/tox/commits/5973025ae7f9/
Changeset:   5973025ae7f9
User:        evers
Date:        2013-10-10 00:21:11
Summary:     expand install_command_substitutions test case
Affected #:  1 file

diff -r 07a696f394d27c0cefeef318092b3ecba76694ee -r 5973025ae7f92c103d063e79b367afd43a348d4b tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -532,11 +532,13 @@
     def test_install_command_substitutions(self, newconfig):
         config = newconfig("""
             [testenv]
-            install_command=some_install {toxinidir} {envname} {packages}
+            install_command=some_install --arg={toxinidir}/foo \
+                {envname} {opts} {packages}
         """)
         envconfig = config.envconfigs['python']
         assert envconfig.install_command == [
-            'some_install', config.toxinidir, 'python', '{packages}']
+            'some_install', '--arg=%s/foo' % config.toxinidir, 'python',
+            '{opts}', '{packages}']
 
     def test_downloadcache(self, newconfig, monkeypatch):
         monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False)

Repository URL: https://bitbucket.org/hpk42/tox/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the pytest-commit mailing list