Skip to content

Commit 27b8f53

Browse files
committed
allow multiple labels
1 parent c538c23 commit 27b8f53

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

‎src/python/psyplot_ci_orb/__init__.py‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
parser.add_argument(
5757
"-l",
5858
"--label",
59-
help="The label for the file. Default: %(default)s",
60-
default="main",
59+
help="The label for the file.",
60+
action="append",
6161
)
6262

6363
parser.add_argument(
@@ -135,24 +135,25 @@ def main(parser_args=None):
135135
filename,
136136
fd,
137137
distribution_type="conda",
138-
channels=(args.label,),
138+
channels=tuple(args.label or ["main"]),
139139
dependencies=file_attrs.get("dependencies"),
140140
attrs=file_attrs.get("attrs"),
141141
)
142142
print("Success!")
143143
else:
144144
# add the label
145145
print("Package is already available on anaconda.")
146-
if args.label in dist["labels"]:
147-
print(f"Package is already available under the {args.label} label.")
148-
print("Nothing to do for me here.")
149-
else:
150-
print(f"Adding the label {args.label}")
151-
if not args.dry_run:
152-
aserver_api.add_channel(
153-
args.label, user, package, version, filename
154-
)
155-
print("Success!")
146+
for label in args.label:
147+
if label in dist["labels"]:
148+
print(f"Package is already available under the {label} label.")
149+
print("Nothing to do for me here.")
150+
else:
151+
print(f"Adding the label {label}")
152+
if not args.dry_run:
153+
aserver_api.add_channel(
154+
label, user, package, version, filename
155+
)
156+
print("Success!")
156157

157158

158159
if __name__ == "__main__":

0 commit comments

Comments
 (0)