1
1
from __future__ import annotations
2
2
3
- from contextlib import ExitStack
4
3
import itertools
5
4
import logging
6
5
import os
7
6
import platform
8
7
import re
9
8
import shutil
10
9
import stat
11
- from collections . abc import Iterable
10
+ from concurrent . futures import Future , ThreadPoolExecutor , as_completed
12
11
from fnmatch import fnmatch
13
12
from os .path import isabs
14
13
from pathlib import Path
15
14
from subprocess import check_call
16
- from concurrent .futures import ThreadPoolExecutor , Future , as_completed
17
15
18
16
from auditwheel .patcher import ElfPatcher
19
17
@@ -90,10 +88,12 @@ def repair_wheel(
90
88
91
89
new_soname , new_path = copylib (src_path , dest_dir , patcher , dry = True )
92
90
if not new_path .exists () and str (new_path ) not in copy_works :
93
- copy_works [str (new_path )] = pool .submit (copylib , src_path , dest_dir , patcher )
91
+ copy_works [str (new_path )] = pool .submit (
92
+ copylib , src_path , dest_dir , patcher
93
+ )
94
94
soname_map [soname ] = (new_soname , new_path )
95
95
replacements .append ((soname , new_soname ))
96
-
96
+
97
97
def _inner_replace ():
98
98
if replacements :
99
99
patcher .replace_needed (fn , * replacements )
@@ -127,7 +127,9 @@ def _inner_replace():
127
127
ctx .out_wheel = add_platforms (ctx , abis , get_replace_platforms (abis [0 ]))
128
128
129
129
if strip :
130
- for lib , future in itertools .chain (copy_works .items (), replace_works .items ()):
130
+ for lib , future in itertools .chain (
131
+ copy_works .items (), replace_works .items ()
132
+ ):
131
133
logger .info ("Stripping symbols from %s" , lib )
132
134
then (future , check_call , ["strip" , "-s" , lib ])
133
135
@@ -141,7 +143,9 @@ def then(pool: ThreadPoolExecutor, future: Future, *args, **kwargs):
141
143
pool .submit (* args , ** kwargs )
142
144
143
145
144
- def copylib (src_path : Path , dest_dir : Path , patcher : ElfPatcher , dry : bool = False ) -> tuple [str , Path ]:
146
+ def copylib (
147
+ src_path : Path , dest_dir : Path , patcher : ElfPatcher , dry : bool = False
148
+ ) -> tuple [str , Path ]:
145
149
"""Graft a shared library from the system into the wheel and update the
146
150
relevant links.
147
151
0 commit comments