diff --git a/Makefile b/Makefile index b2e49c782ea5d..37ab55fa2309d 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/scripts/generate_minimal_boto3stubs_install.py b/scripts/generate_minimal_boto3stubs_install.py index b5f2ac9488b1d..2a36ff411c2da 100644 --- a/scripts/generate_minimal_boto3stubs_install.py +++ b/scripts/generate_minimal_boto3stubs_install.py @@ -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="") diff --git a/setup.cfg b/setup.cfg index a07782861276a..c5e681c6674a5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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]