Skip to content

Commit

Permalink
fix: avoid boto3 import error in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
newgene committed May 17, 2023
1 parent f841f7e commit 2acf8ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion biothings/utils/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# Suppress import error when we just run CLI
InteractiveShell = object

import biothings.utils.aws as aws
from biothings import config
from biothings.utils.common import timesofar
from biothings.utils.dataload import to_boolean
Expand Down Expand Up @@ -607,6 +606,10 @@ def publish_data_version(s3_bucket, s3_folder, version_info, update_latest=True,
"release_date" : "...", # ISO 8601 timestamp, release date/time
"url": "http...."} # url pointing to release metadata
"""
# import utils.aws within this function to avoid boto3 import error in
# the same like CLI (boto3 is not required)
import biothings.utils.aws as aws

# register version
versionskey = os.path.join(s3_folder, "%s.json" % VERSIONS)
try:
Expand Down

0 comments on commit 2acf8ed

Please sign in to comment.