mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1764534: Maintain site_packages_dir order r=emilio
De-duping with `set` causes order to no longer be maintained when the items are distinct. Use the `OrderedDict` technique to de-dupe consistently instead. Differential Revision: https://phabricator.services.mozilla.com/D143604
This commit is contained in:
parent
6ea9c3b12c
commit
34599d4f60
@ -782,20 +782,17 @@ class PythonVirtualenv:
|
||||
return os.path.join(normalized_venv_root, relative_path)
|
||||
|
||||
def site_packages_dirs(self):
|
||||
return list(
|
||||
filter(
|
||||
None,
|
||||
[
|
||||
# On Windows, the top of the virtualenv is added to the sys.path.
|
||||
self.prefix if sys.platform.startswith("win") else None,
|
||||
# De-dupe with set literal in case purelib and platlib are identical
|
||||
*{
|
||||
self.resolve_sysconfig_packages_path("purelib"),
|
||||
self.resolve_sysconfig_packages_path("platlib"),
|
||||
},
|
||||
],
|
||||
)
|
||||
)
|
||||
dirs = []
|
||||
if sys.platform.startswith("win"):
|
||||
dirs.append(self.prefix)
|
||||
purelib = self.resolve_sysconfig_packages_path("purelib")
|
||||
platlib = self.resolve_sysconfig_packages_path("platlib")
|
||||
|
||||
dirs.append(purelib)
|
||||
if platlib != purelib:
|
||||
dirs.append(platlib)
|
||||
|
||||
return dirs
|
||||
|
||||
def pip_install_with_constraints(self, pip_args):
|
||||
"""Create a pip constraints file or existing packages
|
||||
|
Loading…
Reference in New Issue
Block a user