Commits

holger krekel committed 1015785

fix issue102: change to {toxinidir} when installing packages and dependencies.
this allows to use relative path like in "-rrequirements.txt".

Comments (0)

Files changed (7)

   want to support python2.5/pip1.3.1 based test environments you need 
   to install ssl and/or use PIP_INSECURE=1 through ``setenv``. section.
 
+- fix issue102: change to {toxinidir} when installing dependencies.
+  this allows to use relative path like in "-rrequirements.txt".
+
 1.6.0
 -----------------
 
 # built documents.
 #
 # The short X.Y version.
-release = version = "1.6.0"
+release = version = "1.6.1"
 # The full version, including alpha/beta/rc tags.
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 
     test-specific dependencies -.to be installed into the environment prior to project
     package installation.  Each line defines a dependency, which will be
-    passed to easy_install/pip for processing.  A line specify a file,
+    passed to the installer command for processing.  A line specify a file,
     an URL or a package name.  You can additionally specify
     an :confval:`indexserver` to use for installing this dependency.
     All derived dependencies (deps required by the dep) will then be
 
         deps = :myindexserver:pkg
 
+    (Experimentally introduced in 1.6.1) all installer commands are executed
+    using the ``{toxinidir}`` as the current working directory.
+
 .. confval:: setenv=MULTI-LINE-LIST
    
    .. versionadded:: 0.9

doc/example/basic.txt

 However, you can also create your own test environment names,
 see some of the examples in :doc:`examples <../examples>`.
 
-whitelisting a non-virtualenv commands
+whitelisting non-virtualenv commands
 -----------------------------------------------
 
 .. versionadded:: 1.5
 
 .. _multiindex:
 
+depending on requirements.txt
+-----------------------------------------------
+
+.. versionadded:: 1.6.1
+
+(experimental) If you have a ``requirements.txt`` file
+you can add it to your ``deps`` variable like this::
+
+    deps = -rrequirements.txt 
+
+All installation commands are executed using ``{toxinidir}}``
+(the directory where ``tox.ini`` resides) as the current
+working directory.  Therefore, the underlying ``pip`` installation
+will assume ``requirements.txt`` to exist at ``{toxinidir}/requirements.txt``.
+
 using a different default PyPI url
 -----------------------------------------------
 

doc/example/devenv.txt

     envdir = devenv
     basepython = python2.7
     usedevelop = True
-    deps =
-    commands =
-        pip install -r requirements.txt
+    deps = -rrequirements.txt
 

tests/test_venv.py

     venv.install_deps()
     assert len(l) == 2 + py25calls
     args = l[-1].args
-    assert l[-1].cwd == venv.envconfig.envlogdir
+    assert l[-1].cwd == venv.envconfig.config.toxinidir
     assert "pip" in str(args[0])
     assert args[1] == "install"
     #arg = "--download-cache=" + str(venv.envconfig.downloadcache)
     venv.install_deps()
     assert len(l) == 2 + py25calls
     args = l[-1].args
-    assert l[-1].cwd == venv.envconfig.envlogdir
+    assert l[-1].cwd == venv.envconfig.config.toxinidir
     assert "pip" in str(args[0])
     assert args[1] == "install"
     assert "dep1" in args
             action.setactivity('pip-downgrade', 'pip<1.4')
             argv = ["easy_install"] + \
                    self._installopts(indexserver) + ['pip<1.4']
-            self._pcall(argv, cwd=self.envconfig.envlogdir,
+            self._pcall(argv, cwd=self.envconfig.config.toxinidir,
                         action=action)
 
     def finish(self):
         env = dict(PYTHONIOENCODING='utf_8')
         if extraenv is not None:
             env.update(extraenv)
-        self._pcall(argv, cwd=self.envconfig.envlogdir,
-            extraenv=env, action=action)
+        self._pcall(argv, cwd=self.envconfig.config.toxinidir,
+                    extraenv=env, action=action)
 
     def _install(self, deps, extraopts=None, action=None):
         if not deps: