From c6e9c7eee4fc9582501246f3e082a4acf789bdbe Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Sun, 9 Mar 2014 15:30:33 +0100 Subject: [PATCH] Revert "run tests without depending on an already installed instance" Breaks CLI (and probably other modules that use `dist.version`): [*]~/d/isso:master> isso -c sample.cfg run Traceback (most recent call last): File "/home/.../dev/isso/bin/isso", line 9, in load_entry_point('isso==0.8.dev0', 'console_scripts', 'isso')() File "/home/.../dev/isso/isso/__init__.py", line 198, in main parser.add_argument('--version', action='version', version='%(prog)s ' + dist.version) AttributeError: 'module' object has no attribute 'version This reverts commit 4e5e8c44f77ae6a3aacbc2cfd78c4965c60b33d5. --- isso/__init__.py | 3 ++- isso/views/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/isso/__init__.py b/isso/__init__.py index da5e7a0..a59311d 100644 --- a/isso/__init__.py +++ b/isso/__init__.py @@ -27,7 +27,8 @@ from __future__ import print_function -import isso as dist +import pkg_resources +dist = pkg_resources.get_distribution("isso") # check if exectuable is `isso` and gevent is available import sys diff --git a/isso/views/__init__.py b/isso/views/__init__.py index 0108b0d..0b995cd 100644 --- a/isso/views/__init__.py +++ b/isso/views/__init__.py @@ -2,7 +2,8 @@ from __future__ import unicode_literals -import isso as dist +import pkg_resources +dist = pkg_resources.get_distribution("isso") import json