33
44from auditwheel import policy
55
6-
7- def add_zlib_versions ():
8- with open (join (dirname (abspath (policy .__file__ )), "manylinux-policy.json" ), 'r' ) as manylinux_policy :
9- manylinux_policy_lines = manylinux_policy .readlines ()
10-
11- manylinux_policy_data = ""
12- for line in manylinux_policy_lines :
13- if "ZLIB" in line :
14- if len (line ) > 22 :
15- updated_line = line [:- 2 ] + ', "1.2.9", "1.2.12", "1.2.13"]'
16- else :
17- updated_line = line [:- 2 ] + '"1.2.9", "1.2.12", "1.2.13"]'
18- print ("auditwheel patch: replace policy line \" %s\" with \" %s\" " % (line , updated_line ))
19- manylinux_policy_replacement = line .replace (line , updated_line )
20- else :
21- manylinux_policy_replacement = line
22- manylinux_policy_data = manylinux_policy_data + manylinux_policy_replacement
23-
24- with open (join (dirname (abspath (policy .__file__ )), "manylinux-policy.json" ), 'w' ) as manylinux_final_policy :
25- manylinux_final_policy .write (manylinux_policy_data )
26-
276def add_whitelisted_libs ():
287 policies = None
298
@@ -36,7 +15,5 @@ def add_whitelisted_libs():
3615 with open (join (dirname (abspath (policy .__file__ )), "manylinux-policy.json" ), "w" ) as f :
3716 f .write (json .dumps (policies ))
3817
39-
4018if __name__ == '__main__' :
41- add_zlib_versions ()
4219 add_whitelisted_libs ()
0 commit comments