diff options
| author | holger krekel <holger@merlinux.eu> | 2013-12-09 16:06:00 +0100 |
|---|---|---|
| committer | holger krekel <holger@merlinux.eu> | 2013-12-09 16:06:00 +0100 |
| commit | 37674ee538a97cbc5c29135b139049b4b4bbdf3d (patch) | |
| tree | 2bb9118dade2e082ac9180d622a790ba89ede993 | |
| parent | 142f0130c09177989c20a4c5527156aab93311b2 (diff) | |
| download | tox-37674ee538a97cbc5c29135b139049b4b4bbdf3d.tar.gz | |
introduce --sitepackages to force sitepackages=True in all
environments. Was wanted by Debian maintainer Barry Warsaw.
| -rwxr-xr-x | CHANGELOG | 3 | ||||
| -rw-r--r-- | tests/test_config.py | 5 | ||||
| -rw-r--r-- | tox/_config.py | 9 |
3 files changed, 15 insertions, 2 deletions
@@ -47,6 +47,9 @@ - introduce --no-network to tox's own test suite to skip tests requiring networks +- introduce --sitepackages to force sitepackages=True in all + environments. + 1.6.1 ----- diff --git a/tests/test_config.py b/tests/test_config.py index 5d11d88..b8d0aa3 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -451,6 +451,11 @@ class TestConfigTestEnv: # hashseed is random by default, so we can't assert a specific value. assert int_hashseed > 0 + def test_sitepackages_switch(self, tmpdir, newconfig): + config = newconfig(["--sitepackages"], "") + envconfig = config.envconfigs['python'] + assert envconfig.sitepackages == True + def test_installpkg_tops_develop(self, newconfig): config = newconfig(["--installpkg=abc"], """ [testenv] diff --git a/tox/_config.py b/tox/_config.py index e7ac443..6006fa9 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -129,7 +129,10 @@ def prepare_parse(pkgname): metavar="REQ", default=None, help="Forces a certain version of one of the dependencies " "when configuring the virtual environment. REQ Examples " - "'pytest<2.4' or 'django>=1.6'.") + "'pytest<2.7' or 'django>=1.6'.") + parser.add_argument("--sitepackages", action="store_true", + help="override sitepackages setting to True in all envs") + parser.add_argument("args", nargs="*", help="additional arguments available to command positional substitution") return parser @@ -355,7 +358,9 @@ class parseini: name = self._replace_forced_dep(name, config) vc.deps.append(DepConfig(name, ixserver)) vc.distribute = reader.getbool(section, "distribute", False) - vc.sitepackages = reader.getbool(section, "sitepackages", False) + vc.sitepackages = self.config.option.sitepackages or \ + reader.getbool(section, "sitepackages", False) + vc.downloadcache = None downloadcache = reader.getdefault(section, "downloadcache") if downloadcache: |
