如果我看一下aws_cdk.cloudformation_include
的setup.py,你会看到一个很大的依赖项列表;
"install_requires": [
"aws-cdk.alexa-ask==1.85.0",
"aws-cdk.aws-accessanalyzer==1.85.0",
"aws-cdk.aws-acmpca==1.85.0",
"aws-cdk.aws-amazonmq==1.85.0",
"aws-cdk.aws-amplify==1.85.0",
"aws-cdk.aws-apigateway==1.85.0",
"aws-cdk.aws-apigatewayv2==1.85.0",
"aws-cdk.aws-appconfig==1.85.0",
"aws-cdk.aws-appflow==1.85.0",
"aws-cdk.aws-applicationautoscaling==1.85.0",
"aws-cdk.aws-applicationinsights==1.85.0",
"aws-cdk.aws-appmesh==1.85.0",
"aws-cdk.aws-appstream==1.85.0",
"aws-cdk.aws-appsync==1.85.0",
"aws-cdk.aws-athena==1.85.0",
"aws-cdk.aws-auditmanager==1.85.0",
"aws-cdk.aws-autoscaling==1.85.0",
...
这里定义了不同服务的所有aws-cdk库,但是如果我只需要aws-cdk.aws-stepfunctions
呢?
是否有办法限制我们想要安装的依赖项的数量?或者我们对这个项目有什么建议,以允许我们只安装我们需要的依赖?也许我们可以在setup.py
中利用extras_require
?
pip install aws-cdk.cloudformation-include[aws-cdk.aws-stepfunctions]
安装必要的依赖项+步骤函数的依赖项
我想不出什么直接的解决办法。
你最好的选择可能是安装没有依赖:
python -m pip install --no-deps aws_cdk.cloudformation_include
,然后安装所需的依赖项。