本文整理汇总了Python中botocore.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python botocore.__version__方法的具体用法?Python botocore.__version__怎么用?Python botocore.__version__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botocore
的用法示例。
在下文中一共展示了botocore.__version__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_patches
# 需要导入模块: import botocore [as 别名]
# 或者: from botocore import __version__ [as 别名]
def test_patches():
print("Botocore version: {} aiohttp version: {}".format(
botocore.__version__, aiohttp.__version__))
success = True
for obj, digests in chain(_AIOHTTP_DIGESTS.items(), _API_DIGESTS.items()):
digest = hashlib.sha1(getsource(obj).encode('utf-8')).hexdigest()
if digest not in digests:
print("Digest of {}:{} not found in: {}".format(
obj.__qualname__, digest, digests))
success = False
assert success
# NOTE: this doesn't require moto but needs to be marked to run with coverage
示例2: determine_prefix
# 需要导入模块: import botocore [as 别名]
# 或者: from botocore import __version__ [as 别名]
def determine_prefix():
"""Placeholder docstring"""
prefix = "AWS-SageMaker-Python-SDK/{} Python/{} {}/{} Boto3/{} Botocore/{}".format(
SDK_VERSION, PYTHON_VERSION, OS_NAME, OS_VERSION, boto3.__version__, botocore.__version__
)
try:
with open("/etc/opt/ml/sagemaker-notebook-instance-version.txt") as sagemaker_nbi_file:
prefix = "AWS-SageMaker-Notebook-Instance/{} {}".format(
sagemaker_nbi_file.read().strip(), prefix
)
except IOError:
# This file isn't expected to always exist, and we DO want to silently ignore failures.
pass
return prefix
示例3: _get_botocore_session
# 需要导入模块: import botocore [as 别名]
# 或者: from botocore import __version__ [as 别名]
def _get_botocore_session():
if _get_botocore_session.botocore_session is None:
LOG.debug('Creating new Botocore Session')
LOG.debug('Botocore version: {0}'.format(botocore.__version__))
session = botocore.session.get_session({
'profile': (None, _profile_env_var, _profile, None),
})
session.set_config_variable('region', _region_name)
session.set_config_variable('profile', _profile)
session.register_component('data_loader', _get_data_loader())
_set_user_agent_for_session(session)
_get_botocore_session.botocore_session = session
if _debug:
session.set_debug_logger()
return _get_botocore_session.botocore_session
示例4: show_version
# 需要导入模块: import botocore [as 别名]
# 或者: from botocore import __version__ [as 别名]
def show_version():
""" display version information and then exit """
import os
import inspect
import awscli
import boto3
import botocore
import subprocess
print("aws_with version: {}".format(sys.modules["aws_with"].VERSION))
print("aws_with key libraries:")
print(" aws {} from {}".format(
subprocess.check_output(['aws','--version'], stderr=subprocess.STDOUT).replace('\n',''),
subprocess.check_output(['which','aws']).replace('\n','')
))
print(" awscli {} from {}".format(awscli.__version__, os.path.dirname(inspect.getfile(awscli))))
print(" boto3 {} from {}".format(boto3.__version__, os.path.dirname(inspect.getfile(boto3))))
print(" botocore {} from {}".format(botocore.__version__, os.path.dirname(inspect.getfile(botocore))))
print(" python {} from {}".format(sys.version.replace('\n',''), sys.executable))
sys.exit(0)
示例5: version_command
# 需要导入模块: import botocore [as 别名]
# 或者: from botocore import __version__ [as 别名]
def version_command(self) -> None:
print('tomodachi/{}'.format(tomodachi.__version__))
sys.exit(0)