summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2015-04-22 21:33:16 +0200
committerholger krekel <holger@merlinux.eu>2015-04-22 21:33:16 +0200
commit8f1958c015b2f414e9812803b05a020f48559337 (patch)
treeb3af595568a14cdd1107046d6431b2d7f62e4495
parent6f8455810223de5df3d4214c34160a736c0dd515 (diff)
parent6ccab1d394a1fbe55208739cc418b94a18edf1df (diff)
downloadtox-8f1958c015b2f414e9812803b05a020f48559337.tar.gz
Merged in wmyll6/tox/issue-235-fix-installpkg (pull request #146)
fix issue #235, --installpkg is broken
-rw-r--r--tox/_cmdline.py13
-rw-r--r--tox/result.py11
2 files changed, 20 insertions, 4 deletions
diff --git a/tox/_cmdline.py b/tox/_cmdline.py
index 4037283..5846c7c 100644
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -423,7 +423,14 @@ class Session:
return False
def installpkg(self, venv, sdist_path):
- self.resultlog.set_header(installpkg=sdist_path)
+ """Install source package in the specified virtual environment.
+
+ :param :class:`tox._config.VenvConfig`: Destination environment
+ :param str sdist_path: Path to the source distribution.
+ :return: True if package installed otherwise False.
+ :rtype: bool
+ """
+ self.resultlog.set_header(installpkg=py.path.local(sdist_path))
action = self.newaction(venv, "installpkg", sdist_path)
with action:
try:
@@ -434,6 +441,10 @@ class Session:
return False
def sdist(self):
+ """
+ :return: Path to the source distribution
+ :rtype: py.path.local
+ """
if not self.config.option.sdistonly and (self.config.sdistsrc or
self.config.option.installpkg):
sdist_path = self.config.option.installpkg
diff --git a/tox/result.py b/tox/result.py
index 9954044..ee5ad09 100644
--- a/tox/result.py
+++ b/tox/result.py
@@ -3,6 +3,7 @@ import py
from tox import __version__ as toxver
import json
+
class ResultLog:
def __init__(self, dict=None):
@@ -14,10 +15,13 @@ class ResultLog:
self.dict["host"] = py.std.socket.getfqdn()
def set_header(self, installpkg):
+ """
+ :param py.path.local installpkg: Path ot the package.
+ """
self.dict["installpkg"] = dict(
- md5=installpkg.computehash("md5"),
- sha256=installpkg.computehash("sha256"),
- basename=installpkg.basename,
+ md5=installpkg.computehash("md5"),
+ sha256=installpkg.computehash("sha256"),
+ basename=installpkg.basename,
)
def get_envlog(self, name):
@@ -32,6 +36,7 @@ class ResultLog:
def loads_json(cls, data):
return cls(json.loads(data))
+
class EnvLog:
def __init__(self, reportlog, name, dict):
self.reportlog = reportlog