From aeebcf8bd32df390163089a33c57815bb7214763 Mon Sep 17 00:00:00 2001 From: "Jonas L." Date: Tue, 21 Jul 2026 09:57:30 +0200 Subject: [PATCH 1/3] feat: add deprecation info to load balancer type (#674) Add the `deprecation` object property to the `LoadBalancerType` domain. https://docs.hetzner.cloud/changelog#2026-06-05-deprecation-info-for-load-balancer-types --- hcloud/load_balancer_types/domain.py | 6 +++++- tests/unit/load_balancer_types/test_client.py | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hcloud/load_balancer_types/domain.py b/hcloud/load_balancer_types/domain.py index 1e594e94..7814a4f4 100644 --- a/hcloud/load_balancer_types/domain.py +++ b/hcloud/load_balancer_types/domain.py @@ -3,6 +3,7 @@ from typing import Any from ..core import BaseDomain, DomainIdentityMixin +from ..deprecation import DeprecationInfo __all__ = [ "LoadBalancerType", @@ -28,7 +29,7 @@ class LoadBalancerType(BaseDomain, DomainIdentityMixin): Max amount of certificates the Load Balancer can serve :param prices: List of dict Prices in different locations - + :param deprecation: Define if and when the Load Balancer Type is deprecated. """ __api_properties__ = ( @@ -40,6 +41,7 @@ class LoadBalancerType(BaseDomain, DomainIdentityMixin): "max_targets", "max_assigned_certificates", "prices", + "deprecation", ) __slots__ = __api_properties__ @@ -53,6 +55,7 @@ def __init__( max_targets: int | None = None, max_assigned_certificates: int | None = None, prices: list[dict[str, Any]] | None = None, + deprecation: dict[str, Any] | None = None, ): self.id = id self.name = name @@ -62,3 +65,4 @@ def __init__( self.max_targets = max_targets self.max_assigned_certificates = max_assigned_certificates self.prices = prices + self.deprecation = deprecation and DeprecationInfo.from_dict(deprecation) diff --git a/tests/unit/load_balancer_types/test_client.py b/tests/unit/load_balancer_types/test_client.py index 8a5bc628..3c774a30 100644 --- a/tests/unit/load_balancer_types/test_client.py +++ b/tests/unit/load_balancer_types/test_client.py @@ -3,6 +3,7 @@ from unittest import mock import pytest +from dateutil.parser import isoparse from hcloud import Client from hcloud.load_balancer_types import LoadBalancerTypesClient @@ -47,6 +48,10 @@ def test_get_by_id( "included_traffic": 21990232555520, } ] + assert result.deprecation.announced == isoparse("2023-06-01T00:00:00+00:00") + assert result.deprecation.unavailable_after == isoparse( + "2023-09-01T00:00:00+00:00" + ) @pytest.mark.parametrize( "params", [{"name": "lb11", "page": 1, "per_page": 10}, {"name": ""}, {}] From 381d71a34994bc3123a16bde4321cf566f5f3793 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:28:31 +0200 Subject: [PATCH 2/3] chore(deps): replace pre-commit hook pre-commit/mirrors-prettier with jooola/pre-commit-prettier 3.9.6 (#676) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27bc959c..c35de9e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,8 +22,8 @@ repos: args: [--fix=lf] - id: trailing-whitespace - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + - repo: https://github.com/jooola/pre-commit-prettier + rev: 3.9.6 hooks: - id: prettier files: \.(md|ya?ml|js|css)$ From 48f3424b49ece33652cd8ca7163e857ca3fecbb9 Mon Sep 17 00:00:00 2001 From: Hetzner Cloud Bot <45457231+hcloud-bot@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:30:42 +0200 Subject: [PATCH 3/3] chore(main): release v2.23.0 (#672) ### Removed deprecated Datacenter property from Server and PrimaryIP Removed the deprecated Datacenter property from the Server and PrimaryIP resources. Since the property was already removed from the Hetzner Cloud API, we do not consider this a breaking change (see [changelog entry](https://docs.hetzner.cloud/changelog#2026-07-01-removing-datacenters)). > [!IMPORTANT] > **Action required:** Please update all code that accesses `server.datacenter` or `primary_ip.datacenter` to use the `location` property instead, as shown below. **Before:** ```python server = client.server.get_by_id(5) print(server.datacenter) primary_ip = client.primary_ip.get_by_id(5) print(primary_ip.datacenter) ``` **After:** ```python server = client.server.get_by_id(5) print(server.location) primary_ip = client.primary_ip.get_by_id(5) print(primary_ip.location) ``` ### Features - remove datacenter property from server and primary_ip (#668) ([abdadf3](https://github.com/hetznercloud/hcloud-python/commit/abdadf3e7cc5d0edeb38f369955fa83f71b102e5)) - add deprecation info to load balancer type (#674) ([aeebcf8](https://github.com/hetznercloud/hcloud-python/commit/aeebcf8bd32df390163089a33c57815bb7214763)) --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ hcloud/_version.py | 2 +- setup.py | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d40b4b6..2d744fe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## [v2.23.0](https://github.com/hetznercloud/hcloud-python/releases/tag/v2.23.0) + +[Compare to previous version](https://github.com/hetznercloud/hcloud-python/compare/v2.22.0...v2.23.0) + +### Removed deprecated Datacenter property from Server and PrimaryIP + +Removed the deprecated Datacenter property from the Server and PrimaryIP resources. Since the property was already removed from the Hetzner Cloud API, we do not consider this a breaking change (see [changelog entry](https://docs.hetzner.cloud/changelog#2026-07-01-removing-datacenters)). + +> [!IMPORTANT] +> **Action required:** Please update all code that accesses `server.datacenter` or `primary_ip.datacenter` to use the `location` property instead, as shown below. + +**Before:** + +```python +server = client.server.get_by_id(5) +print(server.datacenter) + +primary_ip = client.primary_ip.get_by_id(5) +print(primary_ip.datacenter) +``` + +**After:** + +```python +server = client.server.get_by_id(5) +print(server.location) + +primary_ip = client.primary_ip.get_by_id(5) +print(primary_ip.location) +``` + +### Features + +- remove datacenter property from server and primary_ip (#668) ([abdadf3](https://github.com/hetznercloud/hcloud-python/commit/abdadf3e7cc5d0edeb38f369955fa83f71b102e5)) +- add deprecation info to load balancer type (#674) ([aeebcf8](https://github.com/hetznercloud/hcloud-python/commit/aeebcf8bd32df390163089a33c57815bb7214763)) + ## [v2.22.0](https://github.com/hetznercloud/hcloud-python/releases/tag/v2.22.0) ### Datacenters resource is now deprecated diff --git a/hcloud/_version.py b/hcloud/_version.py index 7576cdbd..8408a231 100644 --- a/hcloud/_version.py +++ b/hcloud/_version.py @@ -1,3 +1,3 @@ from __future__ import annotations -__version__ = "2.22.0" # x-releaser-pleaser-version +__version__ = "2.23.0" # x-releaser-pleaser-version diff --git a/setup.py b/setup.py index d6c47860..93f2a6ab 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="hcloud", - version="2.22.0", # x-releaser-pleaser-version + version="2.23.0", # x-releaser-pleaser-version keywords="hcloud hetzner cloud", description="Official Hetzner Cloud python library", long_description=readme,