|
44 | 44 |
|
45 | 45 | from e3.aws.troposphere import Stack |
46 | 46 |
|
47 | | - from typing import Any |
| 47 | + from typing import Any, Self |
48 | 48 |
|
49 | 49 | logger = logging.getLogger("e3.aws.troposphere.awslambda") |
50 | 50 |
|
@@ -154,7 +154,7 @@ def __init__( |
154 | 154 | self._archive_tmpd: TemporaryDirectory | None = None |
155 | 155 | self._archive_dir: str | None = None |
156 | 156 |
|
157 | | - def __enter__(self) -> PyFunctionAsset: |
| 157 | + def __enter__(self) -> Self: |
158 | 158 | """Create a temporary archive directory.""" |
159 | 159 | if self._archive_dir is None: |
160 | 160 | self._archive_tmpd = TemporaryDirectory() |
@@ -826,10 +826,10 @@ def _show_archive_files(self, archive_path: str | Path) -> list[str]: |
826 | 826 | :param archive_path: path to the archive |
827 | 827 | :return: the list of files in the archive |
828 | 828 | """ |
829 | | - with zipfile.ZipFile(archive_path) as zip: |
| 829 | + with zipfile.ZipFile(archive_path) as archive: |
830 | 830 | return [ |
831 | 831 | f"{line}\n" |
832 | | - for line in sorted(zip.namelist()) |
| 832 | + for line in sorted(archive.namelist()) |
833 | 833 | if not line.endswith(".pyc") |
834 | 834 | ] |
835 | 835 |
|
@@ -1306,11 +1306,11 @@ def create_alias( |
1306 | 1306 | :param default_name: default alias name if none is specified |
1307 | 1307 | """ |
1308 | 1308 | name = config.name if config.name is not None else default_name |
1309 | | - id = name_to_id(f"{self.lambda_name}-{name}-alias") |
| 1309 | + alias_id = name_to_id(f"{self.lambda_name}-{name}-alias") |
1310 | 1310 | return Alias( |
1311 | | - name=id, |
| 1311 | + name=alias_id, |
1312 | 1312 | description=f"{name} alias for {self.lambda_name} lambda", |
1313 | | - alias_name=config.name if config.name is not None else id, |
| 1313 | + alias_name=config.name if config.name is not None else alias_id, |
1314 | 1314 | lambda_arn=self.lambda_arn, |
1315 | 1315 | lambda_version=config.version, |
1316 | 1316 | provisioned_concurrency_config=config.provisioned_concurrency_config, |
|
0 commit comments