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
23 changes: 16 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
directory: "/"
schedule:
interval: "monthly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
interval: "monthly"
groups:
dependencies:
patterns:
- "*"
22 changes: 11 additions & 11 deletions .github/workflows/merge-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ jobs:
if: github.repository == 'NHSDigital/nhs-aws-helpers' && !contains(github.event.head_commit.message, 'tag release version:')
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: setup poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v4
with:
poetry-version: 1.5.1
poetry-version: 2.1.4

- name: add poetry plugins
run: |
poetry self add "poetry-dynamic-versioning[plugin]"

- name: cache virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.venv
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

- name: setup java
if: github.actor != 'dependabot[bot]' && (success() || failure())
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "17"
Expand All @@ -83,7 +83,7 @@ jobs:

- name: publish junit reports
if: success() || failure()
uses: mikepenz/action-junit-report@v2
uses: mikepenz/action-junit-report@v5
with:
check_name: junit reports
report_paths: reports/junit/*.xml
Expand All @@ -98,7 +98,7 @@ jobs:
if: github.repository == 'NHSDigital/nhs-aws-helpers' && github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, 'tag release version:')
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -108,14 +108,14 @@ jobs:
find . -type f | xargs chmod g+w

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: setup poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v4
with:
poetry-version: 1.5.1
poetry-version: 2.1.4

- name: add poetry plugins
run: |
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: github.repository == 'NHSDigital/nhs-aws-helpers'
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -44,7 +44,7 @@ jobs:
git merge --ff-only "${{ github.event.pull_request.head.sha }}"

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -67,7 +67,7 @@ jobs:
if: github.repository == 'NHSDigital/nhs-aws-helpers'
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -96,21 +96,21 @@ jobs:
git merge --ff-only "${{ github.event.pull_request.head.sha }}"

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: setup poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v4
with:
poetry-version: 1.5.1
poetry-version: 2.1.4

- name: add poetry plugins
run: |
poetry self add "poetry-dynamic-versioning[plugin]"

- name: cache virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.venv
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

- name: setup java
if: success() || failure()
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "17"
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:

- name: publish junit reports
if: success() || failure()
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v5
with:
check_name: junit reports
report_paths: reports/junit/*.xml
Expand All @@ -192,7 +192,7 @@ jobs:
if: github.repository == 'NHSDigital/nhs-aws-helpers'
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -213,21 +213,21 @@ jobs:
git merge --ff-only "${{ github.event.pull_request.head.sha }}"

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: setup poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v4
with:
poetry-version: 1.5.1
poetry-version: 2.1.4

- name: add poetry plugins
run: |
poetry self add "poetry-dynamic-versioning[plugin]"

- name: cache virtualenv
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
.venv
Expand Down Expand Up @@ -272,7 +272,7 @@ jobs:
- tox
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -298,14 +298,14 @@ jobs:
git merge --ff-only "${{ github.event.pull_request.head.sha }}"

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: setup poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v4
with:
poetry-version: 1.5.1
poetry-version: 2.1.4

- name: add poetry plugins
run: |
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
poetry 1.8.5
python 3.10.12 3.9.12 3.11.5
poetry 2.1.4
python 3.13.5 3.12.11 3.11.13 3.10.18 3.9.23
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.9'

services:

localstack:
Expand Down
20 changes: 20 additions & 0 deletions nhs_aws_helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@
StandardRetryConditions,
)
from mypy_boto3_athena import AthenaClient
from mypy_boto3_backup import BackupClient
from mypy_boto3_ce import CostExplorerClient
from mypy_boto3_cloudwatch import CloudWatchClient
from mypy_boto3_dynamodb.client import DynamoDBClient
from mypy_boto3_dynamodb.service_resource import DynamoDBServiceResource, Table
from mypy_boto3_dynamodb.type_defs import KeysAndAttributesTypeDef
from mypy_boto3_events import EventBridgeClient
from mypy_boto3_firehose import FirehoseClient
from mypy_boto3_glue import GlueClient
from mypy_boto3_kms.client import KMSClient
from mypy_boto3_lambda.client import LambdaClient
from mypy_boto3_logs.client import CloudWatchLogsClient
Expand Down Expand Up @@ -183,6 +187,10 @@ def s3_client(session: Optional[Session] = None, config: Optional[Config] = None
return _aws("s3", "client", session, config) # type: ignore[no-any-return]


def backup_client(session: Optional[Session] = None, config: Optional[Config] = None) -> BackupClient:
return _aws("backup", "client", session, config) # type: ignore[no-any-return]


def register_retry_handler(
client_or_resource: Union[S3ServiceResource, S3Client],
on_error: Optional[Callable] = None,
Expand Down Expand Up @@ -305,6 +313,18 @@ def secrets_client(session: Optional[Session] = None, config: Optional[Config] =
return _aws("secretsmanager", "client", session, config) # type: ignore[no-any-return]


def glue_client(session: Optional[Session] = None, config: Optional[Config] = None) -> GlueClient:
return _aws("glue", "client", session, config) # type: ignore[no-any-return]


def cost_explorer_client(session: Optional[Session] = None, config: Optional[Config] = None) -> CostExplorerClient:
return _aws("ce", "client", session, config) # type: ignore[no-any-return]


def cloudwatch_client(session: Optional[Session] = None, config: Optional[Config] = None) -> CloudWatchClient:
return _aws("cloudwatch", "client", session, config) # type: ignore[no-any-return]


def secret_value(name: str, session: Optional[Session] = None, config: Optional[Config] = None) -> str:
return secrets_client(session=session, config=config).get_secret_value(SecretId=name)["SecretString"]

Expand Down
1,409 changes: 778 additions & 631 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repository = "https://github.com/NHSDigital/nhs-aws-helpers"
# core dependencies
python = ">=3.9,<4.0"
boto3 = "^1.38.14"
boto3-stubs = {extras = ["s3", "ssm", "secretsmanager", "dynamodb", "stepfunctions", "sqs", "lambda", "logs", "ses", "sns", "events", "kms", "firehose", "athena"], version = "^1.38.6"}
boto3-stubs = {extras = ["s3", "ssm", "secretsmanager", "dynamodb", "stepfunctions", "sqs", "lambda", "logs", "ses", "sns", "events", "kms", "firehose", "athena", "glue", "ce", "cloudwatch", "backup"], version = "^1.38.6"}
botocore-stubs = "^1.38.46"


Expand Down Expand Up @@ -43,7 +43,7 @@ pytest = ["pytest", "petname"]

[tool.black]
line-length = 120
target-version = ['py39', 'py310', 'py311']
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
include = '\.pyi?$'
#extend-exclude = '''
#/(
Expand Down Expand Up @@ -139,13 +139,15 @@ check_untyped_defs = true
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py39,py310,py311
envlist = py39,py310,py311,py312,py313

[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313

[testenv]
deps =
Expand Down
Loading