Skip to content

Commit

Permalink
add boto3-stubs to development deps (localstack#8064)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikschubert authored Apr 4, 2023
1 parent e1b8023 commit 93d96f4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ install-test-only: venv
install-dev: venv ## Install developer requirements into venv
$(VENV_RUN); $(PIP_CMD) install $(PIP_OPTS) -e ".[cli,runtime,test,dev]"

install-dev-types: venv ## Install developer requirements incl. type hints into venv
$(VENV_RUN); $(PIP_CMD) install $(PIP_OPTS) -e ".[cli,runtime,test,dev,typehint]"

install: install-dev entrypoints ## Install full dependencies into venv

entrypoints: ## Run setup.py develop to build entry points
Expand Down
9 changes: 7 additions & 2 deletions scripts/generate_minimal_boto3stubs_install.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
"""
A simple script to generate a pip install command for all boto3-stubs packages we're currently using in LocalStack
"""

import os
import re

if __name__ == "__main__":
with open(
os.path.join(os.path.dirname(__file__), "../localstack/testing/pytest/fixtures.py")
os.path.join(os.path.dirname(__file__), "../localstack/utils/aws/client_types.py")
) as fd:
content = fd.read()
result = re.findall(r"\smypy_boto3_([a-z]+)\s", content)
result = re.findall(r"\smypy_boto3_([a-z0-9_]+)\s", content)
result = [r.replace("_", "-") for r in set(result)]
result.sort()

print(f'pip install "boto3-stubs[{",".join(result)}]"', end="")
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ dev =
# enables flake8 configuration through pyproject.toml
pyproject-flake8>=6.0.0.post1
rstr>=3.2.0

# not strictly necessary for development, but provides type hint support for a better developer experience
typehint =
boto3-stubs[acm,amplify,apigateway,apigatewayv2,appconfig,appsync,athena,autoscaling,backup,batch,ce,cloudformation,cloudfront,cloudtrail,cloudwatch,codecommit,cognito-identity,cognito-idp,dms,docdb,dynamodb,dynamodbstreams,ec2,ecr,ecs,efs,eks,elasticache,elasticbeanstalk,elbv2,emr,es,events,firehose,fis,glacier,glue,iam,iot,iot-data,iotanalytics,iotwireless,kafka,kinesis,kinesisanalytics,kinesisanalyticsv2,kms,lakeformation,lambda,logs,mediastore,mq,mwaa,neptune,opensearch,organizations,pi,qldb,qldb-session,rds,rds-data,redshift,redshift-data,resource-groups,resourcegroupstaggingapi,route53,route53resolver,s3,s3control,sagemaker,sagemaker-runtime,secretsmanager,serverlessrepo,servicediscovery,ses,sesv2,sns,sqs,ssm,stepfunctions,sts,timestream-query,timestream-write,transcribe,xray]

0 comments on commit 93d96f4

Please sign in to comment.