1 new commit in tox:
https://bitbucket.org/hpk42/tox/commits/73d3b0cabef0/
Changeset: 73d3b0cabef0
User: hpk42
Date: 2016-06-20 14:40:36+00:00
Summary: fix issue66 by introducing using default "python -m pip"
and introducing list_dependencies_command. (Ted, Holger)
Affected #: 9 files
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,18 @@
+2.4.0
+-----
+
+- introduce per-venv list_dependencies_command which defaults
+ to "python -m pip freeze" to obtain the list of installed packages.
+ If you need to run python2.6 you need to configure it to
+ something like "pip freeze". Thanks Ted Shaw, Holger Krekel.
+
+- fix issue66, issue121: change install_command to use "python -m pip"
+ by default instead of "pip ..." directly which avoids long shebang
+ issues. If you need to run python2.6 you need to configure it to
+ something like "pip install {opts} {packages}". Thanks Ted Shaw,
+ Holger Krekel.
+
+
2.3.2
-----
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 doc/config.txt
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -105,7 +105,20 @@
**default**::
- pip install {opts} {packages}
+ python -m pip install {opts} {packages}
+
+
+.. confval:: list_dependencies_command
+
+ .. versionadded:: 2.4
+
+ the ``list_dependencies_command`` setting is used for listing
+ the packages installed into the virtual environment.
+
+ **default**::
+
+ python -m pip freeze
+
.. confval:: ignore_errors=True|False(default)
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 setup.py
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,7 @@
description='virtualenv-based automation of test activities',
long_description=open("README.rst").read(),
url='http://tox.testrun.org/',
- version='2.3.2',
+ version='2.4.0.dev1',
license='http://opensource.org/licenses/MIT',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel',
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 tests/test_venv.py
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -137,8 +137,8 @@
assert len(l) == 2
args = l[-1].args
assert l[-1].cwd == venv.envconfig.config.toxinidir
- assert "pip" in str(args[0])
- assert args[1] == "install"
+ assert "pip" in str(args[2])
+ assert args[3] == "install"
# arg = "--download-cache=" + str(venv.envconfig.downloadcache)
# assert arg in args[2:]
args = [arg for arg in args if str(arg).endswith("dep1-1.1.zip")]
@@ -167,8 +167,8 @@
assert len(l) == 2
args = l[-1].args
assert l[-1].cwd == venv.envconfig.config.toxinidir
- assert "pip" in str(args[0])
- assert args[1] == "install"
+ assert "pip" in str(args)
+ assert args[3] == "install"
assert "dep1" in args
assert "dep2" in args
deps = list(filter(None, [x[1] for x in venv._getliveconfig().deps]))
@@ -365,7 +365,7 @@
venv._install(["hello"], action=action)
assert len(l) == 1
args = l[0].args
- assert 'pip' in str(args[0])
+ assert "pip" in [str(x) for x in args]
for x in args:
assert "--download-cache" not in args, args
@@ -597,7 +597,7 @@
venv.run_install_command(packages=["whatever"], action=action)
l = mocksession._pcalls
assert len(l) == 1
- assert 'pip' in l[0].args[0]
+ assert 'pip' in l[0].args[2]
assert 'install' in l[0].args
env = l[0].env
assert env is not None
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox.ini
--- a/tox.ini
+++ b/tox.ini
@@ -13,6 +13,13 @@
[testenv:py26-bare]
deps =
commands = tox -h
+install_command = pip install {opts} {packages}
+list_dependencies_command = pip freeze
+
+[testenv:py26]
+install_command = pip install {opts} {packages}
+list_dependencies_command = pip freeze
+
[testenv:docs]
basepython=python
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/__init__.py
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -1,5 +1,5 @@
#
-__version__ = '2.3.2'
+__version__ = '2.4.0.dev1'
from .hookspecs import hookspec, hookimpl # noqa
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/_pytestplugin.py
--- a/tox/_pytestplugin.py
+++ b/tox/_pytestplugin.py
@@ -195,6 +195,9 @@
return py.std.subprocess.Popen(argv, stdout=stdout, stderr=stderr,
**kw)
def run(self, *argv):
+ if argv[0] == "tox" and sys.version_info[:2] < (2,7):
+ pytest.skip("can not run tests involving calling tox on python2.6.
"
+ "(and python2.6 is about to be deprecated anyway)")
argv = [str(x) for x in argv]
assert py.path.local.sysfind(str(argv[0])), argv[0]
p1 = self.tmpdir.join("stdout")
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/config.py
--- a/tox/config.py
+++ b/tox/config.py
@@ -181,7 +181,7 @@
class InstallcmdOption:
name = "install_command"
type = "argv"
- default = "pip install {opts} {packages}"
+ default = "python -m pip install {opts} {packages}"
help = "install command for dependencies and package under test."
def postprocess(self, testenv_config, value):
@@ -518,6 +518,13 @@
help="install package in develop/editable mode")
parser.add_testenv_attribute_obj(InstallcmdOption())
+
+ parser.add_testenv_attribute(
+ name = "list_dependencies_command",
+ type = "argv",
+ default = "python -m pip freeze",
+ help = "list dependencies for a virtual environment")
+
parser.add_testenv_attribute_obj(DepOption())
parser.add_testenv_attribute(
diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r
73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/session.py
--- a/tox/session.py
+++ b/tox/session.py
@@ -537,8 +537,9 @@
# write out version dependency information
action = self.newaction(venv, "envreport")
with action:
- pip = venv.getcommandpath("pip")
- output = venv._pcall([str(pip), "freeze"],
+ python = venv.getcommandpath("python")
+ args = venv.envconfig.list_dependencies_command
+ output = venv._pcall(args,
cwd=self.config.toxinidir,
action=action)
# the output contains a mime-header, skip it
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
[email protected]
https://mail.python.org/mailman/listinfo/pytest-commit