Tests/store_packs.py
def init_storage_client(service_account=None):
    """Initialize google cloud storage client.

    In case of local dev usage the client will be initialized with user default credentials.
    Otherwise, client will be initialized from service account json that is stored in CirlceCI.

    Args:
        service_account (str): full path to service account json.

    Return:
        storage.Client: initialized google cloud storage client.
    """
    if service_account:
        storage_client = storage.Client.from_service_account_json(service_account)
        print_color("Created gcp service account", LOG_COLORS.GREEN)

        return storage_client
    else:
        # in case of local dev use, ignored the warning of non use of service account.
        warnings.filterwarnings("ignore", message=google.auth._default._CLOUD_SDK_CREDENTIALS_WARNING)
        credentials, project = google.auth.default()
        storage_client = storage.Client(credentials=credentials, project=project)
        print_color("Created gcp privare account", LOG_COLORS.GREEN)

        return storage_client
Initialize google cloud storage client.

    In case of local dev usage the client will be initialized with user default credentials.
    Otherwise, client will be initialized from service account json that is stored in CirlceCI.

    Args:
        service_account (str): full path to service account json.

    Return:
        storage.Client: initialized google cloud storage client.
    
Initialize google cloud storage client.
In case of local dev usage the client will be initialized with user default credentials.
Otherwise, client will be initialized from service account json that is stored in CirlceCI.
Initialize google cloud storage client . In case of local dev usage the client will be initialized with user default credentials . Otherwise client will be initialized from service account json that is stored in CirlceCI .
def init_storage_client(service_account=None):
    if service_account:
        storage_client = storage.Client.from_service_account_json(service_account)
        print_color("Created gcp service account", LOG_COLORS.GREEN)
        return storage_client
    else:
        warnings.filterwarnings("ignore", message=google.auth._default._CLOUD_SDK_CREDENTIALS_WARNING)
        credentials, project = google.auth.default()
        storage_client = storage.Client(credentials=credentials, project=project)
        print_color("Created gcp privare account", LOG_COLORS.GREEN)
        return storage_client
def init_storage_client ( service_account = None ) : if service_account : storage_client = storage . Client . from_service_account_json ( service_account ) print_color ( "Created gcp service account" , LOG_COLORS . GREEN ) return storage_client else : warnings . filterwarnings ( "ignore" , message = google . auth . _default . _CLOUD_SDK_CREDENTIALS_WARNING ) credentials , project = google . auth . default ( ) storage_client = storage . Client ( credentials = credentials , project = project ) print_color ( "Created gcp privare account" , LOG_COLORS . GREEN ) return storage_client
Initialize google cloud storage client.
Initialize google cloud storage client .
"""Initialize google cloud storage client.

    In case of local dev usage the client will be initialized with user default credentials.
    Otherwise, client will be initialized from service account json that is stored in CirlceCI.

    Args:
        service_account (str): full path to service account json.

    Return:
        storage.Client: initialized google cloud storage client.
    """ # in case of local dev use, ignored the warning of non use of service account.
service_account
full path to service account json.
full path to service account json .