Vincent Claes
Vincent Claes

Reputation: 4768

Limit the installation of dependencies defined in setup.py

If I look at the setup.py of aws_cdk.cloudformation_include you see a big list of dependencies;

  "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",
         ...

All the aws-cdk libraries for the different services are defined here, but what if I only need aws-cdk.aws-stepfunctions?

Is there a way to limit the number of dependencies that we want to install? Or what could we suggest on this project to allow us to install only the dependencies we need? Maybe we can leverage extras_require in the setup.py?

for example that we can do:

pip install aws-cdk.cloudformation-include[aws-cdk.aws-stepfunctions]

which installs the necessary dependencies + the stepfunctions dependencies

Upvotes: 1

Views: 268

Answers (1)

sinoroc
sinoroc

Reputation: 22295

There is no straightforward solution, that I can think of.

Your best bet is probably to install without dependencies:

python -m pip install --no-deps aws_cdk.cloudformation_include

and then install the dependencies you need.

Upvotes: 1

Related Questions