8000 fixes · scarito1/rules_python@77735bd · GitHub
[go: up one dir, main page]

Skip to content

Commit 77735bd

Browse files
committed
fixes
1 parent d8c1e09 commit 77735bd

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

python/whl.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ def _whl_impl(repository_ctx):
2424
]
2525

2626
if repository_ctx.attr.extras:
27-
args += ["--extras", ",".join(repository_ctx.attr.extras)]
27+
args += [
28+
"--extras=%s" % extra
29+
for extra in repository_ctx.attr.extras
30+
]
2831

2932
result = repository_ctx.execute(args)
3033
if result.return_code:

rules_python/whl.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ def _parse_metadata(self, content):
110110
name_pattern = re.compile('Name: (.*)')
111111
return { 'name': name_pattern.search(content).group(1) }
112112

113-
class SplitByCommaAndAppend(argparse._AppendAction):
114-
def __call__(self, parser, namespace, values, option_string=None):
115-
for val in values.split(','):
116-
super(SplitByCommaAndAppend, self).__call__(parser, namespace, val, option_string)
117113

118114
parser = argparse.ArgumentParser(
119115
description='Unpack a WHL file as a py_library.')
@@ -127,7 +123,7 @@ def __call__(self, parser, namespace, values, option_string=None):
127123
parser.add_argument('--directory', action='store', default='.',
128124
help='The directory into which to expand things.')
129125

130-
parser.add_argument('--extras', action=SplitByCommaAndAppend,
126+
parser.add_argument('--extras', action='append',
131127
help='The set of extras for which to generate library targets.')
132128

133129
def main():

0 commit comments

Comments
 (0)
0