Skip to content

Commit a639792

Browse files
authored
Default to Python 3.12 (#40)
1 parent 0a37bbb commit a639792

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,18 @@ jobs:
4646
lint-python:
4747
runs-on: ubuntu-latest
4848
steps:
49+
- uses: actions/checkout@v4
50+
4951
- name: Setup python
50-
uses: actions/setup-python@v2
52+
uses: actions/setup-python@v5
5153
with:
52-
python-version: 3.8
54+
python-version: 3.12
5355

5456
- name: Install dependencies
55-
run: pip install --pre flake8==4.0.1 black==22.3.0
57+
run: pip install ruff
5658

57-
- uses: actions/checkout@v4
58-
- run: flake8
59-
- run: black --check .
59+
- run: ruff check .
60+
- run: ruff format --check .
6061

6162
test-python:
6263
runs-on: ubuntu-latest
@@ -71,13 +72,13 @@ jobs:
7172
- name: Setup python
7273
uses: actions/setup-python@v2
7374
with:
74-
python-version: 3.8
75+
python-version: 3.12
7576

7677
# Keep boto version in sync with what is installed inside of the Python
77-
# 3.8 lambda. See the link below for reference.
78+
# 3.12 lambda. See the link below for reference.
7879
# https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
7980
- name: Install dependencies
80-
run: pip install boto3==1.20.32 botocore==1.23.32
81+
run: pip install boto3==1.34.95
8182

8283
- uses: actions/checkout@v4
8384
- run: python -m tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module "codepipeline_notifications" {
5555
| <a name="input_label_key_case"></a> [label\_key\_case](#input\_label\_key\_case) | The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.<br>Possible values: `lower`, `title`, `upper`.<br>Default value: `title`. | `string` | `null` | no |
5656
| <a name="input_label_order"></a> [label\_order](#input\_label\_order) | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no |
5757
| <a name="input_label_value_case"></a> [label\_value\_case](#input\_label\_value\_case) | The letter case of output label values (also used in `tags` and `id`).<br>Possible values: `lower`, `title`, `upper` and `none` (no transformation).<br>Default value: `lower`. | `string` | `null` | no |
58-
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | The runtime to use for the lambda function | `string` | `"python3.8"` | no |
58+
| <a name="input_lambda_runtime"></a> [lambda\_runtime](#input\_lambda\_runtime) | The runtime to use for the lambda function | `string` | `"python3.12"` | no |
5959
| <a name="input_name"></a> [name](#input\_name) | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
6060
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
6161
| <a name="input_pipeline_event_type_ids"></a> [pipeline\_event\_type\_ids](#input\_pipeline\_event\_type\_ids) | The list of pipeline events to trigger a notification on | `list(string)` | <pre>[<br> "started",<br> "failed",<br> "canceled",<br> "resumed",<br> "succeeded",<br> "superseded"<br>]</pre> | no |

lambdas/notifier/notifier.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import logging
33
import os
4-
import typing as t
54
import urllib
65
import urllib.request
76

@@ -39,8 +38,8 @@ def format_slack_attachment(
3938
environment: str,
4039
region: str,
4140
action: str,
42-
revision_summary: t.Optional[str],
43-
revision_url: t.Optional[str],
41+
revision_summary: str | None,
42+
revision_url: str | None,
4443
) -> dict:
4544
execution_link = (
4645
f"<https://{region}.console.aws.amazon.com/codesuite/codepipeline/"

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ variable "approval_event_type_ids" {
8282
variable "lambda_runtime" {
8383
type = string
8484
description = "The runtime to use for the lambda function"
85-
default = "python3.8"
85+
default = "python3.12"
8686
}

0 commit comments

Comments
 (0)