From 6fd65d4615540a2529c51f08d3f4442f2f70d4e0 Mon Sep 17 00:00:00 2001 From: ford-at-aws Date: Mon, 9 Sep 2024 10:04:23 -0400 Subject: [PATCH 1/2] isort --- .tools/readmes/render.py | 7 +++---- .tools/readmes/scanner.py | 2 +- .tools/readmes/update.py | 2 +- .tools/readmes/writeme.py | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.tools/readmes/render.py b/.tools/readmes/render.py index 875517dbe01..d190040abe3 100644 --- a/.tools/readmes/render.py +++ b/.tools/readmes/render.py @@ -1,23 +1,22 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -from collections import defaultdict import datetime import logging import os import re +from collections import defaultdict from dataclasses import asdict from enum import Enum -from jinja2 import Environment, FileSystemLoader, select_autoescape from operator import itemgetter from pathlib import Path from typing import Dict, List, Tuple +import config from aws_doc_sdk_examples_tools.metadata import Example from aws_doc_sdk_examples_tools.sdks import Sdk from aws_doc_sdk_examples_tools.services import Service - -import config +from jinja2 import Environment, FileSystemLoader, select_autoescape from scanner import Scanner logger = logging.getLogger(__name__) diff --git a/.tools/readmes/scanner.py b/.tools/readmes/scanner.py index 15acfae553a..0582248428a 100644 --- a/.tools/readmes/scanner.py +++ b/.tools/readmes/scanner.py @@ -1,13 +1,13 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -import config import logging from collections import defaultdict from os.path import relpath from pathlib import Path from typing import Dict, List, Iterable, Optional, TypeVar +import config from aws_doc_sdk_examples_tools.doc_gen import DocGen from aws_doc_sdk_examples_tools.metadata import Example from aws_doc_sdk_examples_tools.sdks import Sdk diff --git a/.tools/readmes/update.py b/.tools/readmes/update.py index d54d579cba9..2311a400676 100644 --- a/.tools/readmes/update.py +++ b/.tools/readmes/update.py @@ -3,7 +3,7 @@ import logging from pathlib import Path -from subprocess import run, DEVNULL, PIPE, CalledProcessError +from subprocess import DEVNULL, PIPE, CalledProcessError, run from sys import executable diff --git a/.tools/readmes/writeme.py b/.tools/readmes/writeme.py index 69d6bc2f255..eabde9151b4 100644 --- a/.tools/readmes/writeme.py +++ b/.tools/readmes/writeme.py @@ -23,4 +23,4 @@ # importing the things that got changed during update. from runner import main - sys.exit(main()) + sys.exit(main()) \ No newline at end of file From 038925aea4a9fe4b399cb1947b9d3f37f7684285 Mon Sep 17 00:00:00 2001 From: ford-at-aws Date: Mon, 9 Sep 2024 10:04:46 -0400 Subject: [PATCH 2/2] isort and black --- .tools/readmes/config.py | 2 +- .tools/readmes/render.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.tools/readmes/config.py b/.tools/readmes/config.py index 5270f523535..230122157e2 100644 --- a/.tools/readmes/config.py +++ b/.tools/readmes/config.py @@ -136,7 +136,7 @@ "device-farm": "python/example_code/devicefarm", "elastic-load-balancing-v2": "python/example_code/elastic-load-balancing", "secrets-manager": "python/example_code/secretsmanager", - "dynamodb": "python/example_code/dynamodb" + "dynamodb": "python/example_code/dynamodb", }, } }, diff --git a/.tools/readmes/render.py b/.tools/readmes/render.py index d190040abe3..972cda0c1ed 100644 --- a/.tools/readmes/render.py +++ b/.tools/readmes/render.py @@ -274,7 +274,12 @@ def render(self) -> RenderStatus: custom_cats = self._transform_custom_categories() if ( - len(hello) + len(actions) + len(basics) + len(scenarios) + len(custom_cats) + len(crosses) + len(hello) + + len(actions) + + len(basics) + + len(scenarios) + + len(custom_cats) + + len(crosses) == 0 ): return RenderStatus.NO_EXAMPLES