Skip to content

Commit

Permalink
Fix: unable to list global packages if extra is used (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
eight04 authored Jun 12, 2024
1 parent f5bf874 commit 08c78cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions vpip/commands/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ def iter_global_packages():
:rtype: Iterator[PackageInfo]
"""
from packaging.requirements import Requirement
from .. import venv, pip_api
for name in venv.iter_global_packages():
vv = venv.get_global_pkg_venv(name)
for dir_name in venv.iter_global_packages():
vv = venv.get_global_pkg_venv(dir_name)
with vv.activate():
yield PackageInfo(name, pip_api.show([name])[0].version)
req = Requirement(dir_name)
yield PackageInfo(req.name, pip_api.show([req.name])[0].version)

def print_global_packages(check_outdated=False):
for info in iter_global_packages():
Expand Down Expand Up @@ -116,4 +118,4 @@ def __str__(self):
else:
lines.append("{} (not installed)".format(self.name))
return "\n".join(lines)


0 comments on commit 08c78cf

Please sign in to comment.