4 new commits in tox: https://bitbucket.org/hpk42/tox/commits/cf9ab5359f68/ Changeset: cf9ab5359f68 User: hpk42 Date: 2013-08-21 13:45:17 Summary: remove prints Affected #: 1 file
diff -r 714d84b76856a23f7b4967903130b95cd973475a -r cf9ab5359f68a6e6516012d72cc6c066dbb0612f tox/interpreters.py --- a/tox/interpreters.py +++ b/tox/interpreters.py @@ -20,7 +20,6 @@ return self.name2executable[name] except KeyError: self.name2executable[name] = e = find_executable(name) - print ("executable for %s is %s" %(name, e)) return e def get_info(self, name=None, executable=None): @@ -32,7 +31,6 @@ executable = self.get_executable(name) if not executable: return NoInterpreterInfo(name=name) - print ("get info for %s" % executable) try: return self.executable2info[executable] except KeyError: https://bitbucket.org/hpk42/tox/commits/eb540f23a82e/ Changeset: eb540f23a82e User: hpk42 Date: 2013-09-04 14:32:42 Summary: fix test runs on environments without a home directory (in which case we use toxinidir as the homedir) Affected #: 4 files diff -r cf9ab5359f68a6e6516012d72cc6c066dbb0612f -r eb540f23a82efc49cc06f9ecd469506549b325bd CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,9 @@ - fix issue118: correctly have two tests use realpath(). Thanks Barry Warsaw. +- fix test runs on environments without a home directory + (in this case we use toxinidir as the homedir) + 1.6.0 ----------------- diff -r cf9ab5359f68a6e6516012d72cc6c066dbb0612f -r eb540f23a82efc49cc06f9ecd469506549b325bd tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -73,8 +73,7 @@ def test_defaults_distshare(self, tmpdir, newconfig): config = newconfig([], "") envconfig = config.envconfigs['python'] - homedir = py.path.local._gethomedir() - assert config.distshare == homedir.join(".tox", "distshare") + assert config.distshare == config.homedir.join(".tox", "distshare") def test_defaults_changed_dir(self, tmpdir, newconfig): tmpdir.mkdir("abc").chdir() @@ -100,6 +99,18 @@ old.chdir() assert config.toxinipath == toxinipath +def test_get_homedir(monkeypatch): + monkeypatch.setattr(py.path.local, "_gethomedir", + classmethod(lambda x: {}[1])) + assert not get_homedir() + monkeypatch.setattr(py.path.local, "_gethomedir", + classmethod(lambda x: 0/0)) + assert not get_homedir() + monkeypatch.setattr(py.path.local, "_gethomedir", + classmethod(lambda x: "123")) + assert get_homedir() == "123" + + class TestIniParser: def test_getdefault_single(self, tmpdir, newconfig): config = newconfig(""" @@ -582,7 +593,7 @@ assert argv[3][0] == conf.envbindir assert argv[4][0] == conf.envtmpdir assert argv[5][0] == conf.envpython - assert argv[6][0] == str(py.path.local._gethomedir()) + assert argv[6][0] == str(config.homedir) assert argv[7][0] == config.homedir.join(".tox", "distshare") assert argv[8][0] == conf.envlogdir @@ -903,8 +914,7 @@ pypi = http://pypi.python.org/simple """ config = newconfig([], inisource) - homedir = str(py.path.local._gethomedir()) - expected = "file://%s/.pip/downloads/simple" % homedir + expected = "file://%s/.pip/downloads/simple" % config.homedir assert config.indexserver['default'].url == expected assert config.indexserver['local1'].url == \ config.indexserver['default'].url diff -r cf9ab5359f68a6e6516012d72cc6c066dbb0612f -r eb540f23a82efc49cc06f9ecd469506549b325bd tests/test_z_cmdline.py --- a/tests/test_z_cmdline.py +++ b/tests/test_z_cmdline.py @@ -625,18 +625,19 @@ sdist_path = session.sdist() assert sdist_path == p -#@pytest.mark.xfail("sys.platform == 'win32'", reason="test needs better impl") +@pytest.mark.xfail("sys.platform == 'win32' and sys.version_info < (2,6)", + reason="test needs better impl") def test_envsitepackagesdir(cmd, initproj): initproj("pkg512-0.0.5", filedefs={ 'tox.ini': """ [testenv] commands= - python -c "print('X:{envsitepackagesdir}')" + python -c "print(r'X:{envsitepackagesdir}')" """}) result = cmd.run("tox") assert result.ret == 0 result.stdout.fnmatch_lines(""" - X:*.tox*python*site-packages* + X:*tox*site-packages* """) def verify_json_report_format(data, testenvs=True): diff -r cf9ab5359f68a6e6516012d72cc6c066dbb0612f -r eb540f23a82efc49cc06f9ecd469506549b325bd tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -120,12 +120,19 @@ help="additional arguments available to command positional substition") return parser -class Config: +class Config(object): def __init__(self): self.envconfigs = {} self.invocationcwd = py.path.local() self.interpreters = Interpreters() + @property + def homedir(self): + homedir = get_homedir() + if homedir is None: + homedir = self.toxinidir # XXX good idea? + return homedir + class VenvConfig: def __init__(self, **kw): self.__dict__.update(kw) @@ -166,6 +173,12 @@ testenvprefix = "testenv:" +def get_homedir(): + try: + return py.path.local._gethomedir() + except Exception: + return None + class parseini: def __init__(self, config, inipath): config.toxinipath = inipath @@ -186,9 +199,7 @@ else: raise ValueError("invalid context") - config.homedir = py.path.local._gethomedir() - if config.homedir is None: - config.homedir = config.toxinidir # XXX good idea? + reader.addsubstitions(toxinidir=config.toxinidir, homedir=config.homedir) config.toxworkdir = reader.getpath(toxsection, "toxworkdir", https://bitbucket.org/hpk42/tox/commits/264fe64185e4/ Changeset: 264fe64185e4 User: hpk42 Date: 2013-09-04 14:54:02 Summary: fix issue117: python2.5 fix: don't use ``--insecure`` option because its very existence depends on presence of "ssl". If you 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. Affected #: 4 files diff -r eb540f23a82efc49cc06f9ecd469506549b325bd -r 264fe64185e4559c73d48af9db7471ce66bfe64f CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,11 @@ - fix test runs on environments without a home directory (in this case we use toxinidir as the homedir) +- fix issue117: python2.5 fix: don't use ``--insecure`` option because + its very existence depends on presence of "ssl". If you + 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. + 1.6.0 ----------------- diff -r eb540f23a82efc49cc06f9ecd469506549b325bd -r 264fe64185e4559c73d48af9db7471ce66bfe64f doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -99,10 +99,11 @@ **default on environments using python2.5**:: - pip install --insecure {opts} {packages}`` + pip install {opts} {packages}`` - (this will use pip<1.4 (so no ``--pre`` option) and python2.5 - typically has no SSL support, therefore ``--insecure``). + this will use pip<1.4 which has no ``--pre`` option. Note also + that for python2.5 support you may need to install ssl and/or + use ``setenv = PIP_INSECURE=1`` in a py25 based testenv. .. confval:: whitelist_externals=MULTI-LINE-LIST diff -r eb540f23a82efc49cc06f9ecd469506549b325bd -r 264fe64185e4559c73d48af9db7471ce66bfe64f tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -509,7 +509,7 @@ for name in ("x25", "py25-x"): env = config.envconfigs[name] assert env.install_command == \ - "pip install --insecure {opts} {packages}".split() + "pip install {opts} {packages}".split() env = config.envconfigs["py26"] assert env.install_command == \ "pip install --pre {opts} {packages}".split() diff -r eb540f23a82efc49cc06f9ecd469506549b325bd -r 264fe64185e4559c73d48af9db7471ce66bfe64f tox/_config.py --- a/tox/_config.py +++ b/tox/_config.py @@ -330,13 +330,11 @@ downloadcache = os.environ.get("PIP_DOWNLOAD_CACHE", downloadcache) vc.downloadcache = py.path.local(downloadcache) - # on python 2.5 we can't use "--pre" and we typically - # need to use --insecure for pip commands because python2.5 - # doesn't support SSL + # on pip-1.3.1/python 2.5 we can't use "--pre". pip_default_opts = ["{opts}", "{packages}"] info = vc._basepython_info if info.runnable and info.version_info < (2,6): - pip_default_opts.insert(0, "--insecure") + pass else: pip_default_opts.insert(0, "--pre") vc.install_command = reader.getargv( https://bitbucket.org/hpk42/tox/commits/c3ba84e0cc42/ Changeset: c3ba84e0cc42 User: hpk42 Date: 2013-09-04 14:55:13 Summary: merge Affected #: 0 files 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. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit