File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -281,8 +281,15 @@ def compress_file(file_path):
281
281
pypi_token = os .getenv ('PYPI_TOKEN' )
282
282
283
283
# Ensure tokens are available
284
- if not figshare_token or not pypi_token :
285
- raise ValueError ("Required tokens are not set in environment variables." )
284
+ if args .pypi and not pypi_token :
285
+ raise ValueError ("Required tokens (PYPI) are not set in environment variables." )
286
+
287
+ # Ensure tokens are available
288
+ if args .figshare and not figshare_token :
289
+ raise ValueError ("Required tokens (FIGSHARE) are not set in environment variables." )
290
+
291
+ if (args .figshare or args .pypi ) and not args .version :
292
+ raise ValueError ("Version must be specified when pushing to pypi or figshare" )
286
293
287
294
if not os .path .exists (all_files_dir ):
288
295
os .makedirs (all_files_dir )
You can’t perform that action at this time.
0 commit comments