Skip to content

Commit

Permalink
Merge pull request #6307 from sanders41/pipdeptree
Browse files Browse the repository at this point in the history
Add new paths to front of PATH
  • Loading branch information
matteius authored Nov 4, 2024
2 parents 5a51979 + 65c8c5b commit 2383420
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions news/6307.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue where modules could not be found
16 changes: 10 additions & 6 deletions pipenv/vendor/pipdeptree/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@
from typing import Sequence

pardir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# for finding pipdeptree itself
sys.path.append(pardir)
# for finding stuff in vendor and patched
sys.path.append(os.path.dirname(os.path.dirname(pardir)))
# for finding pipdeptree itself, vendor, and patched
sys.path = [pardir, os.path.dirname(os.path.dirname(pardir))] + sys.path

from pipenv.vendor.pipdeptree._cli import get_options
from pipenv.vendor.pipdeptree._detect_env import detect_active_interpreter
from pipenv.vendor.pipdeptree._discovery import get_installed_distributions
from pipenv.vendor.pipdeptree._models import PackageDAG
from pipenv.vendor.pipdeptree._render import render
from pipenv.vendor.pipdeptree._validate import validate
from pipenv.vendor.pipdeptree._warning import WarningPrinter, WarningType, get_warning_printer
from pipenv.vendor.pipdeptree._warning import (
WarningPrinter,
WarningType,
get_warning_printer,
)


def main(args: Sequence[str] | None = None) -> None | int:
Expand All @@ -38,7 +40,9 @@ def main(args: Sequence[str] | None = None) -> None | int:
print(f"(resolved python: {resolved_path})", file=sys.stderr) # noqa: T201

pkgs = get_installed_distributions(
interpreter=options.python, local_only=options.local_only, user_only=options.user_only
interpreter=options.python,
local_only=options.local_only,
user_only=options.user_only,
)
tree = PackageDAG.from_pkgs(pkgs)

Expand Down

0 comments on commit 2383420

Please sign in to comment.