diff options
| author | holger krekel <holger@merlinux.eu> | 2015-04-21 11:59:54 +0200 |
|---|---|---|
| committer | holger krekel <holger@merlinux.eu> | 2015-04-21 11:59:54 +0200 |
| commit | e376e97c966e2f0bcd1286d3b928b2d8cab45768 (patch) | |
| tree | 85a0cb2f6b3ccc3bc327e4ddb3fd5ac1d635a95e | |
| parent | b38964389b2df20c166df11906d77a3f7d56ab76 (diff) | |
| download | tox-e376e97c966e2f0bcd1286d3b928b2d8cab45768.tar.gz | |
remove the long-deprecated "distribute" option as it has no effect these days.
| -rw-r--r-- | CHANGELOG | 1 | ||||
| -rw-r--r-- | doc/Makefile | 2 | ||||
| -rw-r--r-- | doc/config.txt | 9 | ||||
| -rw-r--r-- | doc/links.txt | 1 | ||||
| -rw-r--r-- | tests/test_config.py | 1 | ||||
| -rw-r--r-- | tests/test_venv.py | 36 | ||||
| -rw-r--r-- | tox/_config.py | 3 | ||||
| -rw-r--r-- | tox/_venv.py | 25 |
8 files changed, 13 insertions, 65 deletions
@@ -17,6 +17,7 @@ If platform is set and doesn't match the platform spec in the test environment the test environment is ignored, no setup or tests are attempted. +- remove the long-deprecated "distribute" option as it has no effect these days. 1.9.2 ----------- diff --git a/doc/Makefile b/doc/Makefile index 77b2083..d3393d6 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -37,7 +37,7 @@ clean: -rm -rf $(BUILDDIR)/* install: clean html - @rsync -avz $(BUILDDIR)/html/ testrun.org:/www/testrun.org/tox/latest + @rsync -avz $(BUILDDIR)/html/ testrun.org:/www/testrun.org/tox/dev #latexpdf #@scp $(BUILDDIR)/latex/*.pdf testrun.org:www-tox/latest diff --git a/doc/config.txt b/doc/config.txt index 04f1678..d2d2854 100644 --- a/doc/config.txt +++ b/doc/config.txt @@ -200,15 +200,6 @@ Complete list of settings that you can put into ``testenv*`` sections: `--download-cache` command-line option. **default**: no download cache will be used. -.. confval:: distribute=True|False - - **DEPRECATED** -- as of August 2013 you should use setuptools - which has merged most of distribute_ 's changes. Just use - the default, Luke! In future versions of tox this option might - be ignored and setuptools always chosen. - - **default:** False. - .. confval:: sitepackages=True|False Set to ``True`` if you want to create virtual environments that also diff --git a/doc/links.txt b/doc/links.txt index 2d98869..9c16034 100644 --- a/doc/links.txt +++ b/doc/links.txt @@ -13,7 +13,6 @@ .. _`easy_install`: http://peak.telecommunity.com/DevCenter/EasyInstall .. _pip: https://pypi.python.org/pypi/pip .. _setuptools: https://pypi.python.org/pypi/setuptools -.. _distribute: https://pypi.python.org/pypi/distribute .. _`jenkins`: http://jenkins-ci.org/ .. _sphinx: https://pypi.python.org/pypi/Sphinx .. _discover: https://pypi.python.org/pypi/discover diff --git a/tests/test_config.py b/tests/test_config.py index 122cbc5..f879918 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -543,7 +543,6 @@ class TestConfigTestEnv: envconfig = config.envconfigs['python'] assert envconfig.commands == [["xyz", "--abc"]] assert envconfig.changedir == config.setupdir - assert envconfig.distribute == False assert envconfig.sitepackages == False assert envconfig.develop == False assert envconfig.envlogdir == envconfig.envdir.join("log") diff --git a/tests/test_venv.py b/tests/test_venv.py index 3a3689c..1baf578 100644 --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -80,22 +80,6 @@ def test_commandpath_venv_precendence(tmpdir, monkeypatch, p = venv.getcommandpath("easy_install") assert py.path.local(p).relto(envconfig.envbindir), p -def test_create_distribute(monkeypatch, mocksession, newconfig): - config = newconfig([], """ - [testenv:py123] - distribute=False - """) - envconfig = config.envconfigs['py123'] - venv = VirtualEnv(envconfig, session=mocksession) - assert venv.path == envconfig.envdir - assert not venv.path.check() - venv.create() - l = mocksession._pcalls - assert len(l) >= 1 - args = l[0].args - assert "--distribute" not in map(str, args) - assert "--setuptools" in map(str, args) - def test_create_sitepackages(monkeypatch, mocksession, newconfig): config = newconfig([], """ [testenv:site] @@ -158,7 +142,6 @@ def test_install_downloadcache(newmocksession, monkeypatch, tmpdir, envdc): monkeypatch.delenv("PIP_DOWNLOAD_CACHE", raising=False) mocksession = newmocksession([], """ [testenv:py123] - distribute=True deps= dep1 dep2 @@ -458,18 +441,6 @@ class TestCreationConfig: venv.update() mocksession.report.expect("*", "*recreate*") - def test_distribute_recreation(self, newconfig, mocksession): - config = newconfig([], "") - envconfig = config.envconfigs['python'] - venv = VirtualEnv(envconfig, session=mocksession) - venv.update() - cconfig = venv._getliveconfig() - cconfig.distribute = True - cconfig.writeconfig(venv.path_config) - mocksession._clearmocks() - venv.update() - mocksession.report.expect("verbosity0", "*recreate*") - def test_develop_recreation(self, newconfig, mocksession): config = newconfig([], "") envconfig = config.envconfigs['python'] @@ -523,7 +494,7 @@ def test_env_variables_added_to_pcall(tmpdir, mocksession, newconfig, monkeypatc config = newconfig([], """ [testenv:python] commands=python -V - passenv = X123 + passenv = x123 setenv = ENV_VAR = value """) @@ -544,8 +515,9 @@ def test_env_variables_added_to_pcall(tmpdir, mocksession, newconfig, monkeypatc assert env['VIRTUAL_ENV'] == str(venv.path) assert env['X123'] == "123" - assert set(env) == set(["ENV_VAR", "VIRTUAL_ENV", "PYTHONHASHSEED", - "X123", "PATH"]) + assert set(["ENV_VAR", "VIRTUAL_ENV", "PYTHONHASHSEED", "X123", "PATH"])\ + .issubset(env) + #for e in os.environ: # assert e in env diff --git a/tox/_config.py b/tox/_config.py index 2fae46a..80d61bb 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -375,7 +375,7 @@ class parseini: vc.passenv.add("PATHEXT") # needed for discovering executables for spec in reader.getlist(section, "passenv", sep=" "): for name in os.environ: - if fnmatchcase(name, spec): + if fnmatchcase(name.lower(), spec.lower()): vc.passenv.add(name) vc.setenv = setenv @@ -403,7 +403,6 @@ class parseini: break vc.platform = platform - vc.distribute = reader.getbool(section, "distribute", False) vc.sitepackages = self.config.option.sitepackages or \ reader.getbool(section, "sitepackages", False) diff --git a/tox/_venv.py b/tox/_venv.py index 8666785..926a893 100644 --- a/tox/_venv.py +++ b/tox/_venv.py @@ -7,20 +7,18 @@ import tox from tox._config import DepConfig class CreationConfig: - def __init__(self, md5, python, version, distribute, sitepackages, + def __init__(self, md5, python, version, sitepackages, develop, deps): self.md5 = md5 self.python = python self.version = version - self.distribute = distribute self.sitepackages = sitepackages self.develop = develop self.deps = deps def writeconfig(self, path): lines = ["%s %s" % (self.md5, self.python)] - lines.append("%s %d %d %d" % (self.version, self.distribute, - self.sitepackages, self.develop)) + lines.append("%s %d %d" % (self.version, self.sitepackages, self.develop)) for dep in self.deps: lines.append("%s %s" % dep) path.ensure() @@ -32,27 +30,21 @@ class CreationConfig: lines = path.readlines(cr=0) value = lines.pop(0).split(None, 1) md5, python = value - version, distribute, sitepackages, develop = lines.pop(0).split( - None, 3) - distribute = bool(int(distribute)) + version, sitepackages, develop = lines.pop(0).split(None, 3) sitepackages = bool(int(sitepackages)) develop = bool(int(develop)) deps = [] for line in lines: md5, depstring = line.split(None, 1) deps.append((md5, depstring)) - return CreationConfig(md5, python, version, - distribute, sitepackages, develop, deps) - except KeyboardInterrupt: - raise - except: + return CreationConfig(md5, python, version, sitepackages, develop, deps) + except Exception: return None def matches(self, other): return (other and self.md5 == other.md5 and self.python == other.python and self.version == other.version - and self.distribute == other.distribute and self.sitepackages == other.sitepackages and self.develop == other.develop and self.deps == other.deps) @@ -148,7 +140,6 @@ class VirtualEnv(object): python = self.envconfig._basepython_info.executable md5 = getdigest(python) version = tox.__version__ - distribute = self.envconfig.distribute sitepackages = self.envconfig.sitepackages develop = self.envconfig.develop deps = [] @@ -157,7 +148,7 @@ class VirtualEnv(object): md5 = getdigest(raw_dep) deps.append((md5, raw_dep)) return CreationConfig(md5, python, version, - distribute, sitepackages, develop, deps) + sitepackages, develop, deps) def _getresolvedeps(self): l = [] @@ -183,10 +174,6 @@ class VirtualEnv(object): config_interpreter = self.getsupportedinterpreter() args = [sys.executable, '-m', 'virtualenv'] - if self.envconfig.distribute: - args.append("--distribute") - else: - args.append("--setuptools") if self.envconfig.sitepackages: args.append('--system-site-packages') # add interpreter explicitly, to prevent using |
