Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ filelock==3.18.0; python_version>="3.9"
filelock==3.16.1; python_version<"3.9"

# formatter
black==24.10.0; python_version>="3.9"
black==25.1.0; python_version>="3.9"
black==24.8.0; python_version<"3.9"
psutil==7.0.0
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Python script that prepares artifacts for SAM CLI to invoke.
Python script that prepares artifacts for SAM CLI to invoke.
This script will work in both Linux/MacOS and Windows.

It consists of 5 steps:
1. create a temporary TF backend (create_backend_override)
2. run `terraform init -reconfigure`
3. run `terraform apply` on the SAM CLI Metadata resource
4. run `terraform out` to produce an output
5. parse the output to locate the built artifact, and move it to the SAM CLI
5. parse the output to locate the built artifact, and move it to the SAM CLI
build artifact directory (find_and_copy_assets)

Note: This script intentionally does not use Python3 specific syntax.
Expand Down
2 changes: 1 addition & 1 deletion samcli/hook_packages/terraform/hooks/prepare/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Contains the data types used in the TF prepare hook"""
"""Contains the data types used in the TF prepare hook"""

from abc import ABC
from copy import deepcopy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Maintain the utilities functions used in prepare hook """
"""Maintain the utilities functions used in prepare hook"""

from samcli.hook_packages.terraform.hooks.prepare.constants import COMPILED_REGULAR_EXPRESSION

Expand Down
2 changes: 1 addition & 1 deletion samcli/hook_packages/terraform/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def build_cfn_logical_id(tf_address: str) -> str:


def _calculate_configuration_attribute_value_hash(
configuration_attribute_value: Union[str, List[Union[ConstantValue, ResolvedReference]]]
configuration_attribute_value: Union[str, List[Union[ConstantValue, ResolvedReference]]],
) -> str:
"""
Create a hash value of an attribute value of the resource configuration.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Companion stack template builder
Companion stack template builder
"""

from typing import Dict, cast
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Companion stack manager
Companion stack manager
"""

import logging
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/bootstrap/companion_stack/data_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Date type classes for companion stacks
Date type classes for companion stacks
"""

import posixpath
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/cookiecutter/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Exceptions raised from the cookiecutter workflow"""
"""Exceptions raised from the cookiecutter workflow"""


class CookiecutterErrorException(Exception):
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/cookiecutter/interactive_flow_creator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" This module parses a json/yaml file that defines a flow of questions to fulfill the cookiecutter context"""
"""This module parses a json/yaml file that defines a flow of questions to fulfill the cookiecutter context"""

from typing import Dict, Optional, Tuple

Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/cookiecutter/processor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Define a processor to process the cookiecutter context before/after generating a cookiecutter project"""
"""Define a processor to process the cookiecutter context before/after generating a cookiecutter project"""

from abc import ABC, abstractmethod
from typing import Dict
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/cookiecutter/question.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" This module represents the questions to ask to the user to fulfill the cookiecutter context. """
"""This module represents the questions to ask to the user to fulfill the cookiecutter context."""

from abc import ABC, abstractmethod
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/package/stream_cursor_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# NOTE: ANSI escape codes.
# NOTE: Still needs investigation on non terminal environments.
ESC = "\u001B["
ESC = "\u001b["

# Enables ANSI escape codes on Windows
if platform.system().lower() == "windows":
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/pipeline/bootstrap/resource.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Represents AWS resource"""
"""Represents AWS resource"""

from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/pipeline/bootstrap/stage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Application Environment """
"""Application Environment"""

import hashlib
import json
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/schemas/schemas_api_caller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" To isolate Schemas API calls """
"""To isolate Schemas API calls"""

import json
import logging
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/schemas/schemas_aws_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" configure Schemas client based on AWS configuration provided by user """
"""configure Schemas client based on AWS configuration provided by user"""

import click
from boto3.session import Session
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/schemas/schemas_code_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Isolates code download and merge logic for dynamic Schemas template """
"""Isolates code download and merge logic for dynamic Schemas template"""

import json
import os
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/schemas/schemas_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Constant related to Schemas """
"""Constant related to Schemas"""

# cookiecutter template parameter
SCHEMAS_REGISTRY = "AWS_Schema_registry"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Responsible for building schema code directory hierarchy based on schema name """
"""Responsible for building schema code directory hierarchy based on schema name"""

import re

Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/sync/sync_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""SyncFlow base class """
"""SyncFlow base class"""

import logging
from abc import ABC, abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/utils/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Read info from runtime_config.json file"""
"""Read info from runtime_config.json file"""

import json
import logging
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/utils/git_repo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Manage Git repo """
"""Manage Git repo"""

import logging
import os
Expand Down
3 changes: 1 addition & 2 deletions samcli/lib/utils/graphql_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Helper functions to work with SAM GraphQLApi resource
"""
"""Helper functions to work with SAM GraphQLApi resource"""

from typing import Any, Dict, List, Tuple, Union

Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/utils/managed_cloudformation_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def _update_stack(


def _generate_stack_parameters(
parameter_overrides: Optional[Dict[str, Union[str, List[str]]]] = None
parameter_overrides: Optional[Dict[str, Union[str, List[str]]]] = None,
) -> List[Dict[str, str]]:
parameters = []
if parameter_overrides:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def test_invoke_with_env_vars_with_functionname_defined(self, function_name):
process_stdout = stdout.strip()
self.assertEqual(process_stdout.decode("utf-8"), '"MyVar"')

@parameterized.expand([("EchoGlobalCustomEnvVarFunction")])
@parameterized.expand(["EchoGlobalCustomEnvVarFunction"])
@pytest.mark.flaky(reruns=3)
def test_invoke_with_global_env_vars_function(self, function_name):
command_list = InvokeIntegBase.get_command_list(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/local/invoke/test_integrations_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def test_invoke_with_env_vars_with_functionname_defined(self, function_name):
process_stdout = stdout.strip()
self.assertEqual(process_stdout.decode("utf-8"), '"MyVar"')

@parameterized.expand([("EchoGlobalCustomEnvVarFunction")])
@parameterized.expand(["EchoGlobalCustomEnvVarFunction"])
@pytest.mark.flaky(reruns=3)
def test_invoke_with_global_env_vars_function(self, function_name):
command_list = InvokeIntegBase.get_command_list(
Expand Down
32 changes: 16 additions & 16 deletions tests/unit/commands/samconfig/test_samconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def test_build(self, do_cli_mock):
"docker_network": "mynetwork",
"skip_pull_image": True,
"parameter_overrides": "ParameterKey=Key,ParameterValue=Value ParameterKey=Key2,ParameterValue=Value2",
"container_env_var": [("")],
"container_env_var": [""],
"container_env_var_file": "file",
"build_image": [("")],
"exclude": [("")],
"build_image": [""],
"exclude": [""],
"mount_with": "read",
"mount_symlinks": True,
}
Expand Down Expand Up @@ -178,10 +178,10 @@ def test_build_with_no_use_container(self, do_cli_mock):
"docker_network": "mynetwork",
"skip_pull_image": True,
"parameter_overrides": "ParameterKey=Key,ParameterValue=Value ParameterKey=Key2,ParameterValue=Value2",
"container_env_var": [("")],
"container_env_var": [""],
"container_env_var_file": "file",
"build_image": [("")],
"exclude": [("")],
"build_image": [""],
"exclude": [""],
"mount_with": "read",
}

Expand Down Expand Up @@ -237,10 +237,10 @@ def test_build_with_no_use_container_option(self, do_cli_mock):
"docker_network": "mynetwork",
"skip_pull_image": True,
"parameter_overrides": "ParameterKey=Key,ParameterValue=Value ParameterKey=Key2,ParameterValue=Value2",
"container_env_var": [("")],
"container_env_var": [""],
"container_env_var_file": "file",
"build_image": [("")],
"exclude": [("")],
"build_image": [""],
"exclude": [""],
"mount_with": "read",
}

Expand Down Expand Up @@ -297,10 +297,10 @@ def test_build_with_no_use_container_override(self, do_cli_mock):
"docker_network": "mynetwork",
"skip_pull_image": True,
"parameter_overrides": "ParameterKey=Key,ParameterValue=Value ParameterKey=Key2,ParameterValue=Value2",
"container_env_var": [("")],
"container_env_var": [""],
"container_env_var_file": "file",
"build_image": [("")],
"exclude": [("")],
"build_image": [""],
"exclude": [""],
"mount_with": "read",
}

Expand Down Expand Up @@ -358,10 +358,10 @@ def test_build_with_no_cached_override(self, do_cli_mock):
"docker_network": "mynetwork",
"skip_pull_image": True,
"parameter_overrides": "ParameterKey=Key,ParameterValue=Value ParameterKey=Key2,ParameterValue=Value2",
"container_env_var": [("")],
"container_env_var": [""],
"container_env_var_file": "file",
"build_image": [("")],
"exclude": [("")],
"build_image": [""],
"exclude": [""],
"mount_with": "read",
}

Expand Down Expand Up @@ -418,7 +418,7 @@ def test_build_with_container_env_vars(self, do_cli_mock):
"docker_network": "mynetwork",
"skip_pull_image": True,
"parameter_overrides": "ParameterKey=Key,ParameterValue=Value ParameterKey=Key2,ParameterValue=Value2",
"container_env_var": [("")],
"container_env_var": [""],
"container_env_var_file": "env_vars_file",
"mount_with": "read",
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/lib/schemas/test_schemas_aws_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Test AWS configuration """
"""Test AWS configuration"""

from unittest import TestCase
from unittest.mock import patch, ANY, Mock
Expand Down
Loading