Skip to content
Closed
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
8 changes: 4 additions & 4 deletions rules_python/whl.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ def expand(self, directory):

# _parse_metadata parses METADATA files according to https://www.python.org/dev/peps/pep-0314/
def _parse_metadata(self, content):
# TODO: handle fields other than just name
name_pattern = re.compile('Name: (.*)')
return { 'name': name_pattern.search(content).group(1) }

# TODO: handle fields other than just name and extras
name = re.compile('Name: (.*)').search(content).group(1)
extras = [extra.strip() for extra in re.findall('Provides-Extra: (.*)', content)]
return { 'name': name, 'extras': extras }

parser = argparse.ArgumentParser(
description='Unpack a WHL file as a py_library.')
Expand Down
Binary file modified tools/piptool.par
Binary file not shown.
Binary file modified tools/whltool.par
Binary file not shown.