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

Remove OrderedDict #441

Merged
merged 3 commits into from
Sep 11, 2023
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
3 changes: 1 addition & 2 deletions src/auditwheel/main_show.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import logging
from collections import OrderedDict

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -101,7 +100,7 @@ def execute(args, p):
printp("The wheel requires no external shared libraries! :)")
else:
printp("The following external shared libraries are required " "by the wheel:")
print(json.dumps(OrderedDict(sorted(libs.items())), indent=4))
print(json.dumps(dict(sorted(libs.items())), indent=4))

for p in sorted(load_policies(), key=lambda p: p["priority"]):
if p["priority"] > get_priority_by_name(winfo.overall_tag):
Expand Down
5 changes: 2 additions & 3 deletions src/auditwheel/repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import re
import shutil
import stat
from collections import OrderedDict
from os.path import abspath, basename, dirname, exists, isabs
from os.path import join as pjoin
from subprocess import check_call
Expand Down Expand Up @@ -191,8 +190,8 @@ def is_valid_rpath(rpath: str) -> bool:
old_rpaths = patcher.get_rpath(lib_name)
rpaths = filter(is_valid_rpath, old_rpaths.split(":"))
# Remove duplicates while preserving ordering
# Fake an OrderedSet using OrderedDict
rpath_set = OrderedDict([(old_rpath, "") for old_rpath in rpaths])
# Fake an OrderedSet using a dict (ordered in python 3.7+)
rpath_set = {old_rpath: "" for old_rpath in rpaths}
mwtoews marked this conversation as resolved.
Show resolved Hide resolved
rpath_set[rpath] = ""

patcher.set_rpath(lib_name, ":".join(rpath_set))
Expand Down