From c7904ef70f70194a7c6d1d0107cef27cdbcb9224 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Tue, 20 Feb 2024 10:50:47 -0500 Subject: [PATCH] lint --- integration_tests/cdk/config.py | 1 + integration_tests/cdk/eoapi_template/pgStacInfra.py | 10 ++++------ integration_tests/cdk/eoapi_template/vpc.py | 5 ++--- lib/database/bootstrapper_runtime/handler.py | 8 +++++++- lib/ingestor-api/runtime/src/loader.py | 1 + lib/ingestor-api/runtime/src/services.py | 2 +- lib/stac-api/runtime/src/config.py | 1 + 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/integration_tests/cdk/config.py b/integration_tests/cdk/config.py index 0bc6c46..b1ebcdd 100644 --- a/integration_tests/cdk/config.py +++ b/integration_tests/cdk/config.py @@ -5,6 +5,7 @@ from pydantic_core.core_schema import FieldValidationInfo from pydantic_settings import BaseSettings, SettingsConfigDict + class AppConfig(BaseSettings): model_config = SettingsConfigDict( env_file=".env" diff --git a/integration_tests/cdk/eoapi_template/pgStacInfra.py b/integration_tests/cdk/eoapi_template/pgStacInfra.py index f4d70b0..e585ae0 100644 --- a/integration_tests/cdk/eoapi_template/pgStacInfra.py +++ b/integration_tests/cdk/eoapi_template/pgStacInfra.py @@ -36,17 +36,16 @@ def __init__( version=aws_rds.PostgresEngineVersion.VER_14 ), vpc_subnets=aws_ec2.SubnetSelection( - subnet_type=aws_ec2.SubnetType.PUBLIC + subnet_type=aws_ec2.SubnetType.PUBLIC, ), allocated_storage=app_config.db_allocated_storage, instance_type=aws_ec2.InstanceType(app_config.db_instance_type), - bootstrapper_lambda_function_options={ + bootstrapper_lambda_function_options={ "allow_public_subnet": True, } ) - - pgstac_db.db.connections.allow_default_port_from_any_ipv4() + pgstac_db.db.connections.allow_default_port_from_any_ipv4() PgStacApiLambda( self, @@ -71,6 +70,5 @@ def __init__( buckets=[], lambda_function_options={ "allow_public_subnet": True, - }, + }, ) - \ No newline at end of file diff --git a/integration_tests/cdk/eoapi_template/vpc.py b/integration_tests/cdk/eoapi_template/vpc.py index b6bd3ba..fdcc495 100644 --- a/integration_tests/cdk/eoapi_template/vpc.py +++ b/integration_tests/cdk/eoapi_template/vpc.py @@ -23,17 +23,16 @@ def __init__(self, scope: Construct, app_config: AppConfig, **kwargs) -> None: ] ) - self.vpc.add_interface_endpoint( "SecretsManagerEndpoint", service=aws_ec2.InterfaceVpcEndpointAwsService.SECRETS_MANAGER, ) - + self.vpc.add_interface_endpoint( "CloudWatchEndpoint", service=aws_ec2.InterfaceVpcEndpointAwsService.CLOUDWATCH_LOGS, ) - + self.export_value( self.vpc.select_subnets(subnet_type=aws_ec2.SubnetType.PUBLIC) .subnets[0] diff --git a/lib/database/bootstrapper_runtime/handler.py b/lib/database/bootstrapper_runtime/handler.py index 9313d3c..317e5a0 100644 --- a/lib/database/bootstrapper_runtime/handler.py +++ b/lib/database/bootstrapper_runtime/handler.py @@ -2,6 +2,7 @@ Custom resource lambda handler to bootstrap Postgres db. Source: https://github.com/developmentseed/eoAPI/blob/master/deployment/handlers/db_handler.py """ + import json import boto3 @@ -58,7 +59,12 @@ def send( headers = {"content-type": "", "content-length": str(len(json_responseBody))} try: - response = httpx.put(responseUrl, data=json_responseBody, headers=headers, timeout=30) + response = httpx.put( + responseUrl, + data=json_responseBody, + headers=headers, + timeout=30, + ) print("Status code: " + response.status_code) except Exception as e: print("send(..) failed executing httpx.put(..): " + str(e)) diff --git a/lib/ingestor-api/runtime/src/loader.py b/lib/ingestor-api/runtime/src/loader.py index 82fa7f9..5cbd486 100644 --- a/lib/ingestor-api/runtime/src/loader.py +++ b/lib/ingestor-api/runtime/src/loader.py @@ -1,4 +1,5 @@ """Utilities to bulk load data into pgstac from json/ndjson.""" + import logging from pypgstac.load import Loader as BaseLoader diff --git a/lib/ingestor-api/runtime/src/services.py b/lib/ingestor-api/runtime/src/services.py index ee827a5..ef263fe 100644 --- a/lib/ingestor-api/runtime/src/services.py +++ b/lib/ingestor-api/runtime/src/services.py @@ -40,5 +40,5 @@ def fetch_many( } -class NotInDb(Exception): +class NotInDb(Exception): # noqa ... diff --git a/lib/stac-api/runtime/src/config.py b/lib/stac-api/runtime/src/config.py index 27dfe6d..948dc8a 100644 --- a/lib/stac-api/runtime/src/config.py +++ b/lib/stac-api/runtime/src/config.py @@ -1,5 +1,6 @@ """API settings. Based on https://github.com/developmentseed/eoAPI/tree/master/src/eoapi/stac""" + import base64 import json from typing import Optional