Commits

holger krekel  committed 9e0dd9b

change substitution syntax once more, to:

{[section]name}

this is cleaner because the "[" can not be part of a section name
whereas the prior "$" could be part of the section name.

  • Participants
  • Parent commits 9a00169

Comments (0)

Files changed (8)

 -----------------
 
 - tweak and improve reporting
-
 - refactor reporting and virtualenv manipulation 
   to be more accessible from 3rd party tools
 - support value substitution from other sections
-  with {section$key}
+  with the {[section]key} syntax
 - fix issue29 - correctly point to pytest explanation
   for importing modules fully qualified
 - fix issue32 - use --system-site-packages and don't pass --no-site-packages

File doc/config.txt

 
 Values from other sections can be refered to via::
 
-   {sectionkey}
+   {[sectionname]valuename}
 
-which is great for pulling in defaults like::
+which you can use to avoid repetition of config values.
+You can put default values in one section and reference them in others to avoid repeting the same values::
 
-    [tools]
-    testing =
+    [base]
+    deps =
         pytest
         mock
         pytest-xdist
     [testenv:dulwich]
     deps =
         dulwich
-        {tools$testing}
+        {[tools]deps}
 
     [testenv:mercurial]
     dep =
         mercurial
-        {tools$testing}
+        {[tools]deps}
+
 
 
 Other Rules and notes
         description='virtualenv-based automation of test activities',
         long_description=long_description,
         url='http://codespeak.net/tox',
-        version='1.4.dev6',
+        version='1.4.dev7',
         license='GPLv2 or later',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
         author='holger krekel',

File tests/test_config.py

                 pytest-cov
             [testenv:py24]
             deps=
-                {testenv$deps}
+                {[testenv]deps}
                 fun
         """
         conf = newconfig([], inisource).envconfigs['py24']
                 mock
             [testenv]
             deps=
-                {testing:pytest$deps}
-                {testing:mock$deps}
+                {[testing:pytest]deps}
+                {[testing:mock]deps}
                 fun
         """
         conf = newconfig([], inisource)
 
             [testing]
             deps=
-                {testing:pytest$deps}
-                {testing:mock$deps}
+                {[testing:pytest]deps}
+                {[testing:mock]deps}
 
             [testenv]
             deps=
-                {testing$deps}
+                {[testing]deps}
                 fun
         """
         conf = newconfig([], inisource)
         inisource="""
             [testing:pytest]
             deps=
-                {testing:mock$deps}
+                {[testing:mock]deps}
             [testing:mock]
             deps=
-                {testing:pytest$deps}
- 
+                {[testing:pytest]deps}
+
             [testenv]
             deps=
-                {testing:pytest$deps}
+                {[testing:pytest]deps}
         """
         py.test.raises(ValueError, newconfig, [], inisource)
 
             [common]
             changedir = testing
             [testenv]
-            changedir = {common$changedir}
+            changedir = {[common]changedir}
         """
         conf = newconfig([], inisource).envconfigs['python']
         assert conf.changedir.basename == 'testing'
 basepython=python
 changedir=doc
 deps=:pypi:sphinx
-     {testenv$deps}
+     {[testenv]deps}
 commands=
-    py.test -v \
+    py.test -v 
         --junitxml={envlogdir}/junit-{envname}.xml \
         check_sphinx.py []
 

File tox/__init__.py

 #
-__version__ = '1.4.dev6'
+__version__ = '1.4.dev7'
 
 class exception:
     class Error(Exception):

File tox/_config.py

                     (key, envkey))
             return os.environ[envkey]
         if key not in self._subs:
-            if'$' in key:
-                section, item = key.rsplit('$', 1)
-
+            if key.startswith("[") and "]" in key:
+                i = key.find("]")
+                section, item = key[1:i], key[i+1:]
                 if section in self._cfg and item in self._cfg[section]:
                     if (section, item) in self._subststack:
-                        raise ValueError('%s already in %s' %((section, item), self._subststack))
+                        raise ValueError('%s already in %s' %(
+                                (section, item), self._subststack))
                     x = str(self._cfg[section][item])
                     self._subststack.append((section, item))
                     try:

File toxbootstrap.py

 
 """
 
-__version__ = '1.4.dev6'
+__version__ = '1.4.dev7'
 
 import sys
 import os