Skip to content

Commit

Permalink
Suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
  • Loading branch information
andyneff committed May 16, 2024
1 parent 073d392 commit 8f3aaf7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions python/vsi/tools/patch_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def main(filename, name=None, version=None):
filename])).wait()

if pid.returncode != 0:
raise RuntimeError('Wheel unpack failed. Is the wheel is bad?')
raise RuntimeError('Wheel unpack failed. Is the wheel bad?')

# Find the .dist-info directory
dist_info_dirs = [
Expand All @@ -58,18 +58,11 @@ def main(filename, name=None, version=None):
original_name = next(line_split[1].strip() for line in meta_lines if (line_split := line.split(':',1))[0] == 'Name')
original_version = next(line_split[1].strip() for line in meta_lines if (line_split := line.split(':',1))[0] == 'Version')

print(original_name)
print(original_version)

meta_lines = (patch[key]
if (key := line.split(':',1)[0]) in patch.keys()
else line
for line in meta_lines)

# original_name = next(
# original_name, original_version = parsed_name.group('name', 'ver')


# These values will be replaced
patch = {}
if name is not None:
Expand All @@ -85,13 +78,10 @@ def main(filename, name=None, version=None):
raise WheelError('No change detected. Package name and version are '
'identical')


# Patch metadata

with open(metadata, 'w') as fid:
fid.writelines(meta_lines)


# Rename files
# https://peps.python.org/pep-0491/#escaping-and-unicode
normalized_name = re.sub(r"[^\w\d.]+", "_", name).lower()
Expand Down

0 comments on commit 8f3aaf7

Please sign in to comment.