From f35f5009aa45cc5eb3055bd2598c7b6b233f3772 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 11:12:06 +0200 Subject: [PATCH] deps: update dependency hcloud to v1.31.0 (#370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [hcloud](https://togithub.com/hetznercloud/hcloud-python) ([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md)) | `1.30.0` -> `1.31.0` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.30.0/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.30.0/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
hetznercloud/hcloud-python (hcloud) ### [`v1.31.0`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1310-2023-10-23) [Compare Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.30.0...v1.31.0) ##### Features - prepare for iso deprecated field removal ([#​320](https://togithub.com/hetznercloud/hcloud-python/issues/320)) ([beae328](https://togithub.com/hetznercloud/hcloud-python/commit/beae328dd6b9afb8c0db9fa9b44340270db7dd09)) ##### Dependencies - update pre-commit hook psf/black-pre-commit-mirror to v23.10.0 ([#​319](https://togithub.com/hetznercloud/hcloud-python/issues/319)) ([184bbe6](https://togithub.com/hetznercloud/hcloud-python/commit/184bbe65a736a42d13774b6c29fa7dd8a13ec645))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo --- .../module_utils/vendor/hcloud/_version.py | 2 +- .../module_utils/vendor/hcloud/isos/domain.py | 23 +++++++++++++------ scripts/vendor.py | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/plugins/module_utils/vendor/hcloud/_version.py b/plugins/module_utils/vendor/hcloud/_version.py index 1a01ca7..d7f9786 100644 --- a/plugins/module_utils/vendor/hcloud/_version.py +++ b/plugins/module_utils/vendor/hcloud/_version.py @@ -1,3 +1,3 @@ from __future__ import annotations -VERSION = "1.30.0" # x-release-please-version +VERSION = "1.31.0" # x-release-please-version diff --git a/plugins/module_utils/vendor/hcloud/isos/domain.py b/plugins/module_utils/vendor/hcloud/isos/domain.py index 3a5d814..b2f4d30 100644 --- a/plugins/module_utils/vendor/hcloud/isos/domain.py +++ b/plugins/module_utils/vendor/hcloud/isos/domain.py @@ -1,9 +1,7 @@ from __future__ import annotations -try: - from dateutil.parser import isoparse -except ImportError: - isoparse = None +from datetime import datetime +from warnings import warn from ..core import BaseDomain, DomainIdentityMixin from ..deprecation import DeprecationInfo @@ -35,7 +33,6 @@ class Iso(BaseDomain, DomainIdentityMixin): "type", "architecture", "description", - "deprecated", "deprecation", ) @@ -46,7 +43,7 @@ class Iso(BaseDomain, DomainIdentityMixin): type: str | None = None, architecture: str | None = None, description: str | None = None, - deprecated: str | None = None, + deprecated: str | None = None, # pylint: disable=unused-argument deprecation: dict | None = None, ): self.id = id @@ -54,7 +51,19 @@ class Iso(BaseDomain, DomainIdentityMixin): self.type = type self.architecture = architecture self.description = description - self.deprecated = isoparse(deprecated) if deprecated else None self.deprecation = ( DeprecationInfo.from_dict(deprecation) if deprecation is not None else None ) + + @property + def deprecated(self) -> datetime | None: + """ + ISO 8601 timestamp of deprecation, None if ISO is still available. + """ + warn( + "The `deprecated` field is deprecated, please use the `deprecation` field instead.", + DeprecationWarning, + ) + if self.deprecation is None: + return None + return self.deprecation.unavailable_after diff --git a/scripts/vendor.py b/scripts/vendor.py index 089c629..b878842 100755 --- a/scripts/vendor.py +++ b/scripts/vendor.py @@ -20,7 +20,7 @@ from textwrap import dedent logger = logging.getLogger("vendor") HCLOUD_SOURCE_URL = "https://github.com/hetznercloud/hcloud-python" -HCLOUD_VERSION = "v1.30.0" +HCLOUD_VERSION = "v1.31.0" HCLOUD_VENDOR_PATH = "plugins/module_utils/vendor/hcloud"