Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix builds failing due to importerror with moto #211

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions kg_obo/upload.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import botocore.exceptions # type: ignore
import boto3 # type: ignore
from moto import mock_s3 # type: ignore
from moto import mock_aws
import os
import logging
from time import time
Expand Down Expand Up @@ -148,7 +148,7 @@ def upload_dir_to_s3(local_directory: str,

return filelist

@mock_s3
@mock_aws
def mock_check_tracking(s3_bucket: str, s3_bucket_dir: str) -> bool:
"""
Mock checking on existence of the tracking.yaml file on S3.
Expand Down Expand Up @@ -183,7 +183,7 @@ def mock_check_tracking(s3_bucket: str, s3_bucket_dir: str) -> bool:

return tracking_file_exists

@mock_s3
@mock_aws
def mock_check_lock(s3_bucket: str, s3_bucket_dir: str) -> bool:
"""
Mock checking on existence of a lock file on S3 to avoid concurrent runs.
Expand Down Expand Up @@ -214,7 +214,7 @@ def mock_check_lock(s3_bucket: str, s3_bucket_dir: str) -> bool:

return lock_exists

@mock_s3
@mock_aws
def mock_set_lock(s3_bucket: str, s3_bucket_dir: str, unlock: bool) -> bool:
"""
Mocks creating a lock file on S3 to avoid concurrent runs.
Expand Down Expand Up @@ -254,7 +254,7 @@ def mock_set_lock(s3_bucket: str, s3_bucket_dir: str, unlock: bool) -> bool:

return lock_created

@mock_s3
@mock_aws
def mock_upload_dir_to_s3(local_directory: str, s3_bucket: str, s3_bucket_dir: str,
make_public=False) -> list:
"""
Expand Down Expand Up @@ -383,7 +383,7 @@ def update_index_files(bucket: str, remote_path: str, data_dir: str, update_root

return success

@mock_s3
@mock_aws
def mock_update_index_files(bucket: str, remote_path: str, data_dir: str, update_root=False) -> bool:
"""
Mocks checking a specified remote path on the S3 bucket,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def find_version(*file_paths):
'gitpython',
'grape',
'kgx==1.7.0',
'moto[s3]',
'moto>=5.0.0',
'prefixmaps',
'pyyaml',
'recommonmark',
Expand Down
Loading