由mypyboto3buider 4.2.0生成的boto3.ECR 1.16.35服务的类型注释

mypy-boto3-ecr的Python项目详细描述


mypy-boto3-ecr型

PyPI - mypy-boto3-ecrPyPI - Python VersionDocs

boto3.typed

的类型批注 boto3.ECR 1.16.35服务 兼容 VSCodePyCharmEmacsSublime Textmypypyright 以及其他工具。在

mypy-boto3-buider 4.2.0生成。在

更多信息可在boto3-stubs页找到。在

了解它如何帮助查找和修复潜在的错误:

boto3-stubs demo

如何安装

ECR服务安装boto3-stubs。在

python -m pip install boto3-stubs[ecr]

使用

VSCode

  • 安装Python extension
  • 安装Pylance extension
  • Pylance设置为Python语言服务器
  • 在您的环境中安装boto-stubs[ecr]python -m pip install 'boto3-stubs[ecr]'

类型检查和自动完成都应该适用于ECR服务。 不需要显式的类型注释,请照常编写boto3代码。在

PyCharm

  • 在您的环境中安装boto-stubs[ecr]python -m pip install 'boto3-stubs[ecr]'

类型检查和自动完成都应该适用于ECR服务。 不需要显式的类型注释,请照常编写boto3代码。 自动完成在大型项目或安装了大量boto3-stubs子模块时可能会很慢。在

其他IDE

没有经过测试,但是只要您的IDE支持mypy或{},一切都应该正常。在

mypy

  • 安装mypypython -m pip install mypy
  • 在您的环境中安装boto-stubs[ecr]python -m pip install 'boto3-stubs[ecr]'
  • 像往常一样运行mypy

类型检查应该适用于ECR服务。 不需要显式的类型注释,请照常编写boto3代码。在

pyright

  • 安装pyrightyarn global add pyright
  • 在您的环境中安装boto-stubs[ecr]python -m pip install 'boto3-stubs[ecr]'
  • 或者,您可以将boto3-stubs安装到typings文件夹中。在

类型检查应该适用于ECR服务。 不需要显式的类型注释,请照常编写boto3代码。在

显式类型批注

客户端注释

ECRClientboto3.client("ecr")提供注释。在

^{pr2}$

分页器注释

mypy_boto3_ecr.paginator模块包含所有分页器的类型注释。在

frommypy_boto3_ecrimportECRClientfrommypy_boto3_ecr.paginatorimport(DescribeImageScanFindingsPaginator,DescribeImagesPaginator,DescribeRepositoriesPaginator,GetLifecyclePolicyPreviewPaginator,ListImagesPaginator,)client:ECRClient=boto3.client("ecr")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationsdescribe_image_scan_findings_paginator:DescribeImageScanFindingsPaginator=client.get_paginator("describe_image_scan_findings")describe_images_paginator:DescribeImagesPaginator=client.get_paginator("describe_images")describe_repositories_paginator:DescribeRepositoriesPaginator=client.get_paginator("describe_repositories")get_lifecycle_policy_preview_paginator:GetLifecyclePolicyPreviewPaginator=client.get_paginator("get_lifecycle_policy_preview")list_images_paginator:ListImagesPaginator=client.get_paginator("list_images")

服务员注释

mypy_boto3_ecr.waiter模块包含所有等待者的类型注释。在

frommypy_boto3_ecrimportECRClientfrommypy_boto3_ecr.waiterimportImageScanCompleteWaiter,LifecyclePolicyPreviewCompleteWaiterclient:ECRClient=boto3.client("ecr")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationsimage_scan_complete_waiter:ImageScanCompleteWaiter=client.get_waiter("image_scan_complete")lifecycle_policy_preview_complete_waiter:LifecyclePolicyPreviewCompleteWaiter=client.get_waiter("lifecycle_policy_preview_complete")

键入的措辞

mypy_boto3_ecr.type_defs模块包含组合的结构和形状 以进行额外的类型检查。在

frommypy_boto3_ecr.type_defsimport(AttributeTypeDef,AuthorizationDataTypeDef,BatchCheckLayerAvailabilityResponseTypeDef,BatchDeleteImageResponseTypeDef,BatchGetImageResponseTypeDef,CompleteLayerUploadResponseTypeDef,CreateRepositoryResponseTypeDef,DeleteLifecyclePolicyResponseTypeDef,DeleteRegistryPolicyResponseTypeDef,DeleteRepositoryPolicyResponseTypeDef,DeleteRepositoryResponseTypeDef,DescribeImageScanFindingsResponseTypeDef,DescribeImagesFilterTypeDef,DescribeImagesResponseTypeDef,DescribeRegistryResponseTypeDef,DescribeRepositoriesResponseTypeDef,EncryptionConfigurationTypeDef,GetAuthorizationTokenResponseTypeDef,GetDownloadUrlForLayerResponseTypeDef,GetLifecyclePolicyPreviewResponseTypeDef,GetLifecyclePolicyResponseTypeDef,GetRegistryPolicyResponseTypeDef,GetRepositoryPolicyResponseTypeDef,ImageDetailTypeDef,ImageFailureTypeDef,ImageIdentifierTypeDef,ImageScanFindingsSummaryTypeDef,ImageScanFindingsTypeDef,ImageScanFindingTypeDef,ImageScanningConfigurationTypeDef,ImageScanStatusTypeDef,ImageTypeDef,InitiateLayerUploadResponseTypeDef,LayerFailureTypeDef,LayerTypeDef,LifecyclePolicyPreviewFilterTypeDef,LifecyclePolicyPreviewResultTypeDef,LifecyclePolicyPreviewSummaryTypeDef,LifecyclePolicyRuleActionTypeDef,ListImagesFilterTypeDef,ListImagesResponseTypeDef,ListTagsForResourceResponseTypeDef,PaginatorConfigTypeDef,PutImageResponseTypeDef,PutImageScanningConfigurationResponseTypeDef,PutImageTagMutabilityResponseTypeDef,PutLifecyclePolicyResponseTypeDef,PutRegistryPolicyResponseTypeDef,PutReplicationConfigurationResponseTypeDef,ReplicationConfigurationTypeDef,ReplicationDestinationTypeDef,ReplicationRuleTypeDef,RepositoryTypeDef,SetRepositoryPolicyResponseTypeDef,StartImageScanResponseTypeDef,StartLifecyclePolicyPreviewResponseTypeDef,TagTypeDef,UploadLayerPartResponseTypeDef,WaiterConfigTypeDef,)defget_structure()->AttributeTypeDef:return{...}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓中通过TCP发送时java文件损坏   Java测试预期=异常失败,断言错误   java ssh4 LazyInitializationException   java是否可以在集合中添加重复项?   java是一个免费的开源数据库管理工具   java是否可以在导出的html中嵌入图像   编译器构造解释一些东西,并用Java运行生成的字节码?   java KeyPairGenerator未生成随机密钥   java使用正则表达式生成字符串而不是匹配字符串   java中的多线程线程间通信   具有复合密钥的java Hibernate合并问题   java不能在MainActivity类之外使用SharedReferences变量   正在获取切割/零件异常消息。使用java Spring ControllerAdvice   java tomcat漏洞讨论   javascript在Java中实现“system”命令   java如何在JUnit5*中加载*Spring测试上下文之前获取回调?   java bluej关于缺少返回语句   JavaSpringBoot@ModelAttribute包含使用字符串键的其他模型   从可选中抛出异常。ifPresent()Java 8