Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new paths to front of PATH #6307

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading