Skip to content

Commit a3230bf

Browse files
committed
Added more robust checks / validations between steps
1 parent df428eb commit a3230bf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/build_all.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,15 @@ def compress_file(file_path):
281281
pypi_token = os.getenv('PYPI_TOKEN')
282282

283283
# 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")
286293

287294
if not os.path.exists(all_files_dir):
288295
os.makedirs(all_files_dir)

0 commit comments

Comments
 (0)