Skip to content

Commit cf7f945

Browse files
committed
Merge branch 'main' into storage-boxes
2 parents 918de44 + c6aadce commit cf7f945

File tree

61 files changed

+5807
-3243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5807
-3243
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v5
1313

1414
- name: Setup python
15-
uses: actions/setup-python@v5
15+
uses: actions/setup-python@v6
1616
with:
1717
python-version: 3.x
1818

@@ -28,7 +28,7 @@ jobs:
2828
- uses: actions/checkout@v5
2929

3030
- name: Setup python
31-
uses: actions/setup-python@v5
31+
uses: actions/setup-python@v6
3232
with:
3333
python-version: 3.x
3434

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v5
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v5
17+
uses: actions/setup-python@v6
1818
with:
1919
python-version: 3.x
2020

@@ -53,4 +53,4 @@ jobs:
5353
path: dist/
5454

5555
- name: Publish packages to PyPI
56-
uses: pypa/gh-action-pypi-publish@v1.12.4
56+
uses: pypa/gh-action-pypi-publish@v1.13.0

.github/workflows/releaser-pleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: releaser-pleaser
24-
uses: apricote/releaser-pleaser@v0.6.1
24+
uses: apricote/releaser-pleaser@v0.7.1
2525
with:
2626
token: ${{ secrets.HCLOUD_BOT_TOKEN }}
2727
extra-files: |

.github/workflows/test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
python-version:
15+
- "3.10"
16+
- "3.11"
17+
- "3.12"
18+
- "3.13"
19+
- "3.14"
1520

1621
name: Python ${{ matrix.python-version }}
1722
steps:
1823
- uses: actions/checkout@v5
1924

2025
- name: Setup python
21-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
2227
with:
2328
python-version: ${{ matrix.python-version }}
2429

.gitlab-ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pre-commit:
1414
lint:
1515
stage: test
1616

17-
image: python:3.13-alpine
17+
image: python:3.14-alpine
1818
before_script:
1919
- apk add make bash
2020
- make venv
@@ -26,7 +26,12 @@ test:
2626

2727
parallel:
2828
matrix:
29-
- python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
29+
- python_version:
30+
- "3.10"
31+
- "3.11"
32+
- "3.12"
33+
- "3.13"
34+
- "3.14"
3035

3136
image: python:${python_version}-alpine
3237
before_script:

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ repos:
2929
files: \.(md|ya?ml|js|css)$
3030

3131
- repo: https://github.com/asottile/pyupgrade
32-
rev: v3.20.0
32+
rev: v3.21.0
3333
hooks:
3434
- id: pyupgrade
35-
args: [--py39-plus]
35+
args: [--py310-plus]
3636

3737
- repo: https://github.com/pycqa/isort
38-
rev: 6.0.1
38+
rev: 7.0.0
3939
hooks:
4040
- id: isort
4141

4242
- repo: https://github.com/psf/black-pre-commit-mirror
43-
rev: 25.1.0
43+
rev: 25.9.0
4444
hooks:
4545
- id: black
4646

CHANGELOG.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,106 @@
11
# Changelog
22

3+
## [v2.9.0](https://github.com/hetznercloud/hcloud-python/releases/tag/v2.9.0)
4+
5+
### Features
6+
7+
- support python 3.14 (#566)
8+
- drop support for python 3.9 (#574)
9+
10+
## [v2.8.0](https://github.com/hetznercloud/hcloud-python/releases/tag/v2.8.0)
11+
12+
### DNS API Beta
13+
14+
This release adds support for the new [DNS API](https://docs.hetzner.cloud/reference/cloud#dns).
15+
16+
The DNS API is currently in **beta**, which will likely end on 10 November 2025. After the beta ended, it will no longer be possible to create new zones in the old DNS system. See the [DNS Beta FAQ](https://docs.hetzner.com/networking/dns/faq/beta) for more details.
17+
18+
Future minor releases of this project may include breaking changes for features that are related to the DNS API.
19+
20+
See the [DNS API Beta changelog](https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta) for more details.
21+
22+
**Examples**
23+
24+
```py
25+
resp = client.zones.create(
26+
name="example.com",
27+
mode="primary",
28+
labels={"key": "value"},
29+
rrsets=[
30+
ZoneRRSet(
31+
name="@",
32+
type="A",
33+
records=[
34+
ZoneRecord(value="201.180.75.2", comment="server1")
35+
],
36+
)
37+
],
38+
)
39+
40+
resp.action.wait_until_finished()
41+
zone = resp.zone
42+
```
43+
44+
### Features
45+
46+
- add new `ip_range` param to load balancer `attach_to_network` (#562)
47+
- add new `ip_range` param to server `attach_to_network` (#561)
48+
- support the new DNS API (#568)
49+
50+
### Bug Fixes
51+
52+
- source_ips property is optional in firewall rule (#567)
53+
54+
## [v2.7.0](https://github.com/hetznercloud/hcloud-python/releases/tag/v2.7.0)
55+
56+
[Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) now depend on [Locations](https://docs.hetzner.cloud/reference/cloud#locations).
57+
58+
- We added a new `locations` property to the [Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) resource. The new property defines a list of supported [Locations](https://docs.hetzner.cloud/reference/cloud#locations) and additional per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) details such as deprecations information.
59+
60+
- We deprecated the `deprecation` property from the [Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) resource. The property will gradually be phased out as per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) deprecations are being announced. Please use the new per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) deprecation information instead.
61+
62+
See our [changelog](https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types) for more details.
63+
64+
**Upgrading**
65+
66+
```py
67+
# Before
68+
def validate_server_type(server_type: ServerType):
69+
if server_type.deprecation is not None:
70+
raise ValueError(f"server type {server_type.name} is deprecated")
71+
```
72+
73+
```py
74+
# After
75+
def validate_server_type(server_type: ServerType, location: Location):
76+
found = [o for o in server_type.locations if location.name == o.location.name]
77+
if not found:
78+
raise ValueError(
79+
f"server type {server_type.name} is not supported in location {location.name}"
80+
)
81+
82+
server_type_location = found[0]
83+
84+
if server_type_location.deprecation is not None:
85+
raise ValueError(
86+
f"server type {server_type.name} is deprecated in location {location.name}"
87+
)
88+
```
89+
90+
### Features
91+
92+
- per location server types (#558)
93+
94+
## [v2.6.0](https://github.com/hetznercloud/hcloud-python/releases/tag/v2.6.0)
95+
96+
### Features
97+
98+
- add category property to server type (#549)
99+
100+
### Bug Fixes
101+
102+
- rename `ClientEntityBase` to `ResourceClientBase` (#532)
103+
3104
## [v2.5.4](https://github.com/hetznercloud/hcloud-python/releases/tag/v2.5.4)
4105

5106
### Bug Fixes

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ Experimental features are published as part of our regular releases (e.g. a prod
6666
public beta). During an experimental phase, breaking changes on those features may occur
6767
within minor releases.
6868

69+
The stability of experimental features is not related to the stability of its upstream API.
70+
71+
Experimental features have different levels of maturity (e.g. experimental, alpha, beta)
72+
based on the maturity of the upstream API.
73+
6974
While experimental features will be announced in the release notes, you can also find
7075
whether a python class or function is experimental in its docstring:
7176

7277
```
7378
Experimental:
74-
$PRODUCT is experimental, breaking changes may occur within minor releases.
79+
$PRODUCT is $MATURITY, breaking changes may occur within minor releases.
7580
See https://docs.hetzner.cloud/changelog#$SLUG for more details.
7681
```
7782

@@ -151,7 +156,7 @@ To publish experimental features as part of regular releases:
151156
```py
152157
"""
153158
Experimental:
154-
$PRODUCT is experimental, breaking changes may occur within minor releases.
159+
$PRODUCT is $MATURITY, breaking changes may occur within minor releases.
155160
See https://docs.hetzner.cloud/changelog#$SLUG for more details.
156161
"""
157162
```

docs/api.clients.zones.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ZonesClient
2+
==================
3+
4+
5+
.. autoclass:: hcloud.zones.client.ZonesClient
6+
:members:
7+
8+
.. autoclass:: hcloud.zones.client.BoundZone
9+
:members:
10+
11+
.. autoclass:: hcloud.zones.client.BoundZoneRRSet
12+
:members:
13+
14+
.. autoclass:: hcloud.zones.domain.Zone
15+
:members:
16+
17+
.. autoclass:: hcloud.zones.domain.ZoneAuthoritativeNameservers
18+
:members:
19+
20+
.. autoclass:: hcloud.zones.domain.ZonePrimaryNameserver
21+
:members:
22+
23+
.. autoclass:: hcloud.zones.domain.ZoneRecord
24+
:members:
25+
26+
.. autoclass:: hcloud.zones.domain.ZoneRRSet
27+
:members:
28+
29+
.. autoclass:: hcloud.zones.domain.CreateZoneResponse
30+
:members:

examples/get_server_metrics.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

3-
import json
4-
from datetime import datetime, timedelta
3+
from datetime import datetime, timedelta, timezone
54
from os import environ
65

76
from hcloud import Client
@@ -24,7 +23,7 @@
2423
)
2524
server = response.server
2625

27-
end = datetime.now()
26+
end = datetime.now(timezone.utc)
2827
start = end - timedelta(hours=1)
2928

3029
response = server.get_metrics(
@@ -33,4 +32,4 @@
3332
end=end,
3433
)
3534

36-
print(json.dumps(response.metrics))
35+
print(response.metrics)

0 commit comments

Comments
 (0)