Remove vistir.misc.dedup

This function is a nice to have alias for one line of code.
Also, it uses OrderedDict, which is no longer needed. `dict`s after
Python3.6 are guaranteed to be ordered (bonus: dict is faster than
ordered dict).

If we really want, we can also import it from zipp or python finder.
This commit is contained in:
Oz N Tiram
2022-04-23 22:52:30 +02:00
parent c8bb3fe568
commit 1ae251482f
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1395,7 +1395,7 @@ def get_pip_args(
arg_set.extend(arg_map.get(key))
elif key == "selective_upgrade" and not locals().get(key):
arg_set.append("--exists-action=i")
return list(vistir.misc.dedup(arg_set))
return list(dict.fromkeys(arg_set))
def get_requirement_line(
+2 -2
View File
@@ -131,7 +131,6 @@ def translate_markers(pipfile_entry):
if not isinstance(pipfile_entry, Mapping):
raise TypeError("Entry is not a pipfile formatted mapping.")
from pipenv.vendor.packaging.markers import default_environment
from pipenv.vendor.vistir.misc import dedup
allowed_marker_keys = ["markers"] + list(default_environment().keys())
provided_keys = list(pipfile_entry.keys()) if hasattr(pipfile_entry, "keys") else []
@@ -153,7 +152,8 @@ def translate_markers(pipfile_entry):
new_pipfile["markers"] = str(
Marker(
" or ".join(
f"{s}" if " and " in s else s for s in sorted(dedup(marker_set))
f"{s}" if " and " in s else s
for s in sorted(dict.fromkeys(marker_set))
)
)
).replace('"', "'")