Commit 0885841d by Sébastien Eustace Committed by Arun Babu Neelicattu

Read sys_path in reverse to ensure we get the proper paths first

parent 5466b97c
...@@ -14,13 +14,11 @@ class InstalledRepository(Repository): ...@@ -14,13 +14,11 @@ class InstalledRepository(Repository):
def load(cls, env): # type: (Env) -> InstalledRepository def load(cls, env): # type: (Env) -> InstalledRepository
""" """
Load installed packages. Load installed packages.
For now, it uses the pip "freeze" command.
""" """
repo = cls() repo = cls()
seen = set() seen = set()
for entry in env.sys_path: for entry in reversed(env.sys_path):
for distribution in sorted( for distribution in sorted(
metadata.distributions(path=[entry]), key=lambda d: str(d._path), metadata.distributions(path=[entry]), key=lambda d: str(d._path),
): ):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment