Skip to content

Commit

Permalink
fix whitelist_externals on windows, bump version for release prep
Browse files Browse the repository at this point in the history
  • Loading branch information
hpk42 committed Jun 22, 2013
1 parent 69279bd commit 8655cdd
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# built documents.
#
# The short X.Y version.
release = version = "1.4.3"
release = version = "1.5.0"
# The full version, including alpha/beta/rc tags.

# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def run_tests(self):

def main():
version = sys.version_info[:2]
install_requires = ['virtualenv>=1.9.1', 'py>=1.4.13', ]
install_requires = ['virtualenv>=1.9.1', 'py>=1.4.15', ]
if version < (2, 7) or (3, 0) <= version <= (3, 1):
install_requires += ['argparse']
setup(
name='tox',
description='virtualenv-based automation of test activities',
long_description=open("README.rst").read(),
url='http://tox.testrun.org/',
version='1.5.dev12',
version='1.5.0',
license='http://opensource.org/licenses/MIT',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel',
Expand Down
2 changes: 0 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,6 @@ def test_listenvs(self, cmd, initproj):
*docs*
""")

@py.test.mark.xfail("sys.version_info < (2,6)",
reason="virtualenv3 cannot be imported")
def test_config_specific_ini(self, tmpdir, cmd):
ini = tmpdir.ensure("hello.ini")
result = cmd.run("tox", "-c", ini, "--showconfig")
Expand Down
8 changes: 3 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
[tox]
envlist=py27,py26,py25,py32,py33,docs,pypy
indexserver =
testrun = http://pypi.testrun.org
pypi = https://pypi.python.org/simple

[testenv:X]
commands=echo {posargs}

[testenv]
commands=py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs}
commands=py.test --instafail --junitxml={envlogdir}/junit-{envname}.xml {posargs}
deps=pytest==2.3.4
pytest-instafail

[testenv:docs]
basepython=python
changedir=doc
deps=:pypi:sphinx
deps=sphinx
{[testenv]deps}
commands=
py.test -v \
Expand Down
2 changes: 1 addition & 1 deletion tox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
__version__ = '1.5.dev12'
__version__ = '1.5.0'

class exception:
class Error(Exception):
Expand Down
18 changes: 14 additions & 4 deletions tox/_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ def getcommandpath(self, name=None, venv=True, cwd=None):
if p is None:
raise tox.exception.InvocationError(
"could not find executable %r" % (name,))
# p is not found in virtualenv script/bin dir
if venv:
for x in self.envconfig.whitelist_externals:
if p.fnmatch(x):
break
else:
if not self.is_allowed_external(p):
self.session.report.warning(
"test command found but not installed in testenv\n"
" cmd: %s\n"
Expand All @@ -96,6 +94,18 @@ def getcommandpath(self, name=None, venv=True, cwd=None):
self.envconfig.envdir))
return str(p) # will not be rewritten for reporting

def is_allowed_external(self, p):
tryadd = [""]
if sys.platform == "win32":
tryadd += [os.path.normcase(x)
for x in os.environ['PATHEXT'].split(os.pathsep)]
p = py.path.local(os.path.normcase(str(p)))
for x in self.envconfig.whitelist_externals:
for add in tryadd:
if p.fnmatch(x + add):
return True
return False

def _ispython3(self):
return "python3" in str(self.envconfig.basepython)

Expand Down
2 changes: 1 addition & 1 deletion toxbootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"""

__version__ = '1.5.dev12'
__version__ = '1.5.0'

import sys
import os
Expand Down

0 comments on commit 8655cdd

Please sign in to comment.