From cb594e11a15a2e1572edcbe3da9d85c03cd6543d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:17:46 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.1 → 24.1.1](https://github.com/psf/black/compare/23.10.1...24.1.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c1659ba..d634483d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 24.1.1 hooks: - id: black language_version: python3.9 From d1bc48e27de1e96929377ce28415f6a865a278e4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:18:21 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pushsource/_impl/backend/staged/staged_ami.py | 8 +++++--- src/pushsource/_impl/list_cmd.py | 1 + src/pushsource/_impl/model/ami.py | 6 +++--- src/pushsource/_impl/model/erratum_fixup.py | 1 + tests/model/test_errata_from.py | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pushsource/_impl/backend/staged/staged_ami.py b/src/pushsource/_impl/backend/staged/staged_ami.py index 307bd6ea..11f87c59 100644 --- a/src/pushsource/_impl/backend/staged/staged_ami.py +++ b/src/pushsource/_impl/backend/staged/staged_ami.py @@ -49,9 +49,11 @@ def __push_item(self, leafdir, metadata, entry): image_kwargs.update( { - "boot_mode": BootMode(attributes.get("boot_mode")) - if attributes.get("boot_mode") - else None + "boot_mode": ( + BootMode(attributes.get("boot_mode")) + if attributes.get("boot_mode") + else None + ) } ) diff --git a/src/pushsource/_impl/list_cmd.py b/src/pushsource/_impl/list_cmd.py index 35afc128..57f8fd4a 100755 --- a/src/pushsource/_impl/list_cmd.py +++ b/src/pushsource/_impl/list_cmd.py @@ -19,6 +19,7 @@ https://release-engineering.github.io/pushsource/userguide.html """ + import logging import os from argparse import ArgumentParser, RawDescriptionHelpFormatter diff --git a/src/pushsource/_impl/model/ami.py b/src/pushsource/_impl/model/ami.py index 6e3d21be..e08b993c 100644 --- a/src/pushsource/_impl/model/ami.py +++ b/src/pushsource/_impl/model/ami.py @@ -205,9 +205,9 @@ def _from_data(cls, data): "sriov_net_support": data["sriov_net_support"], "ena_support": data.get("ena_support"), "uefi_support": data.get("uefi_support"), - "boot_mode": BootMode(data.get("boot_mode")) - if data.get("boot_mode") - else None, + "boot_mode": ( + BootMode(data.get("boot_mode")) if data.get("boot_mode") else None + ), "billing_codes": AmiBillingCodes._from_data( data.get("billing_codes") or {} ), diff --git a/src/pushsource/_impl/model/erratum_fixup.py b/src/pushsource/_impl/model/erratum_fixup.py index 1d33100b..4c29e60b 100644 --- a/src/pushsource/_impl/model/erratum_fixup.py +++ b/src/pushsource/_impl/model/erratum_fixup.py @@ -25,6 +25,7 @@ tries to eval some code of the form " = ...", which will never work if the name is a keyword. """ + import inspect diff --git a/tests/model/test_errata_from.py b/tests/model/test_errata_from.py index c1a7ef34..9d20aac5 100644 --- a/tests/model/test_errata_from.py +++ b/tests/model/test_errata_from.py @@ -1,4 +1,5 @@ """Tests for special handling of "from" field on errata.""" + from pytest import raises import attr