通过管理多个Amazon Web Services(AWS)帐户的最佳方式是什么boto?
我熟悉BotoConfig文件,我正在使用它.但是每个文件只描述一个帐户......而且我的工作不仅仅是一个组织.出于所有常见的法律,财务和安全原因,这些帐户不能混合使用.
目前我在boto每个帐户使用一个配置文件.例如:
~/.boto 默认帐户~/.boto_clowncollege 为"clowncollege"帐户~/.boto_razorassoc 为"razorassoc"帐户~/.boto_xyz 为"xyz"帐户然后像:
def boto_config_path(account=None):
"""
Given an account name, return the path to the corresponding boto
configuration file. If no account given, return the default config file.
"""
path = '~/.boto' + ('_' + account if account else '')
clean_path = os.path.abspath(os.path.expanduser(path))
if os.path.isfile(clean_path):
return clean_path
else:
errmsg = "cannot find boto config file {} for {}".format(clean_path, account)
raise ValueError(errmsg)
def aws_credentials(account=None): …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个包含数据文件的包,但它不起作用。
我的 setup.cfg (每个链接)如下。
[metadata]
name = my_package
version = 1.0.0
description = My package description
author = John Henckel
author_email = henckel.jonathan@mayo.edu
url = http://example.com
keywords = one, two
license = BSD 3-Clause License
classifiers =
Framework :: Django
License :: OSI Approved :: BSD License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
[options]
include_package_data = True
packages = find:
[options.package_data]
* = *.txt
Run Code Online (Sandbox Code Playgroud)
我的项目的目录结构是...
LICENSE
pyproject.toml
README.md
setup.cfg
my_package
hello.txt
__init__.py …Run Code Online (Sandbox Code Playgroud) 如果您在一个同时使用这两者的项目中工作,setup.py并且Pipfile您经常在:Pipfile/[packages]和 中发现相同的值setup.py/install_requires。
有谁知道我怎么知道Pipfile使用setup.py/install_requiresfor 的值[packages]?