Skip to content

Commit

Permalink
Merge branch 'master' into fix-outline-tables
Browse files Browse the repository at this point in the history
  • Loading branch information
techalchemy authored Oct 10, 2018
2 parents e04b84d + 7ba1f65 commit a9a2491
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions news/2952.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug with importing local vendored dependencies when running ``pipenv graph``.
1 change: 1 addition & 0 deletions news/2957.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug which caused executable discovery to fail when running inside a virtualenv.
10 changes: 7 additions & 3 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ def spinner():

def which(command, location=None, allow_global=False):
if not allow_global and location is None:
location = project.virtualenv_location or os.environ.get("VIRTUAL_ENV", "")
if not location and os.path.exists(location):
raise RuntimeError("virtualenv not created nor specified")
if project.virtualenv_exists:
location = project.virtualenv_location
else:
location = os.environ.get("VIRTUAL_ENV", None)
if not (location and os.path.exists(location)) and not allow_global:
raise RuntimeError("location not created nor specified")
if not allow_global:
if os.name == "nt":
p = find_windows_executable(os.path.join(location, "Scripts"), command)
Expand Down Expand Up @@ -2325,6 +2328,7 @@ def do_check(
def do_graph(bare=False, json=False, json_tree=False, reverse=False):
import pipdeptree


try:
python_path = which("python")
except AttributeError:
Expand Down
2 changes: 2 additions & 0 deletions pipenv/vendor/pipdeptree.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
except ImportError:
from ordereddict import OrderedDict

pardir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(pardir)
from pipenv.vendor.pip_shims import get_installed_distributions, FrozenRequirement

import pkg_resources
Expand Down
6 changes: 4 additions & 2 deletions tasks/vendoring/patches/vendor/pipdeptree-updated-pip18.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/pipenv/vendor/pipdeptree.py b/pipenv/vendor/pipdeptree.py
index 7820aa5..9cce032 100644
index 7820aa5..2082fc8 100644
--- a/pipenv/vendor/pipdeptree.py
+++ b/pipenv/vendor/pipdeptree.py
@@ -13,11 +13,7 @@ try:
@@ -13,11 +13,9 @@ try:
except ImportError:
from ordereddict import OrderedDict

Expand All @@ -11,6 +11,8 @@ index 7820aa5..9cce032 100644
- from pipenv.patched.notpip._internal.operations.freeze import FrozenRequirement
-except ImportError:
- from pipenv.patched.notpip import get_installed_distributions, FrozenRequirement
+pardir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+sys.path.append(pardir)
+from pipenv.vendor.pip_shims import get_installed_distributions, FrozenRequirement

import pkg_resources
Expand Down

0 comments on commit a9a2491

Please sign in to comment.