[Pytest-commit] commit/tox: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Apr 22 21:33:18 CEST 2015


2 new commits in tox:

https://bitbucket.org/hpk42/tox/commits/47b8e230f7b3/
Changeset:   47b8e230f7b3
Branch:      issue-235-fix-installpkg
User:        Vladimir Vitvitskiy
Date:        2015-04-21 23:11:23+00:00
Summary:     fix issue #235, --installpkg is broken

Problem
-----------

Session result log requires `py.path.local` for the source distribution when setting header.
Passing str.

Testing
---------

`tox.ini` configuration::

```
[testenv:X]
commands={posargs}

[testenv:Y]
commands={posargs}
```

# download sdist
pip install -d . ranger

# install with a newly built fox version
tox -e X -- tox -e Y --installpkg ranger-0.9.tar.gz --notest
Affected #:  2 files

diff -r 7fb0ae11640dc5416ba58d58e2858cfe7d7f7c07 -r 47b8e230f7b3c5bd52b8d8d48e140db55e5f4359 tox/_cmdline.py
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -423,7 +423,14 @@
                 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 @@
                 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 -r 7fb0ae11640dc5416ba58d58e2858cfe7d7f7c07 -r 47b8e230f7b3c5bd52b8d8d48e140db55e5f4359 tox/result.py
--- a/tox/result.py
+++ b/tox/result.py
@@ -3,6 +3,7 @@
 from tox import __version__ as toxver
 import json
 
+
 class ResultLog:
 
     def __init__(self, dict=None):
@@ -14,10 +15,13 @@
         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 @@
     def loads_json(cls, data):
         return cls(json.loads(data))
 
+
 class EnvLog:
     def __init__(self, reportlog, name, dict):
         self.reportlog = reportlog


https://bitbucket.org/hpk42/tox/commits/71ea3fac1a1d/
Changeset:   71ea3fac1a1d
User:        hpk42
Date:        2015-04-22 19:33:16+00:00
Summary:     Merged in wmyll6/tox/issue-235-fix-installpkg (pull request #146)

fix issue #235, --installpkg is broken
Affected #:  2 files

diff -r c70e7e6a4c2e2386e51158ae1d4a8f693069acb8 -r 71ea3fac1a1dc6779e34b828cda204a8875ad000 tox/_cmdline.py
--- a/tox/_cmdline.py
+++ b/tox/_cmdline.py
@@ -423,7 +423,14 @@
                 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 @@
                 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 -r c70e7e6a4c2e2386e51158ae1d4a8f693069acb8 -r 71ea3fac1a1dc6779e34b828cda204a8875ad000 tox/result.py
--- a/tox/result.py
+++ b/tox/result.py
@@ -3,6 +3,7 @@
 from tox import __version__ as toxver
 import json
 
+
 class ResultLog:
 
     def __init__(self, dict=None):
@@ -14,10 +15,13 @@
         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 @@
     def loads_json(cls, data):
         return cls(json.loads(data))
 
+
 class EnvLog:
     def __init__(self, reportlog, name, dict):
         self.reportlog = reportlog

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.


More information about the pytest-commit mailing list