Skip to content

Commit d4bbb1c

Browse files
Merge pull request #183 from UpCloudLtd/chore/python-support-from-3-10-to-3-13
chore: drop support for python 3.9
2 parents 13b9624 + 55ce59a commit d4bbb1c

File tree

9 files changed

+17
-19
lines changed

9 files changed

+17
-19
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
strategy:
2424
matrix:
2525
tox_env:
26-
- py39
2726
- py310
2827
- py311
2928
- py312

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
### Changed
13+
14+
- Python versions supported: 3.10, 3.11, 3.12, 3.13, PyPy3. Dropped support for 3.9.
15+
1216
## [2.9.0] - 2025-09-25
1317

1418
### Removed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ python setup.py install
2525

2626
### Supported Python versions
2727

28-
- Python 3.9
2928
- Python 3.10
3029
- Python 3.11
3130
- Python 3.12

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tool.black]
22
line-length = 99
3-
target-version = ['py39']
3+
target-version = ['py310']
44
skip-string-normalization = true
55

66
[tool.ruff]
7-
target-version = "py39"
7+
target-version = "py310"
88
exclude = [
99
".git",
1010
"ENV",

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license = MIT
1212
license_files = []
1313

1414
[options]
15-
python_requires = >=3.9, <4
15+
python_requires = >=3.10, <4
1616
setup_requires =
1717
setuptools
1818
install_requires =

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py39, py310, py311, py312, py313, pypy311
7+
envlist = py310, py311, py312, py313, pypy311
88
skip_missing_interpreters = True
99

1010
[testenv]

upcloud_api/cloud_manager/storage_mixin.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from os import PathLike
2-
from typing import BinaryIO, Optional, Union
2+
from typing import BinaryIO
33

44
from upcloud_api.api import API
55
from upcloud_api.storage import BackupDeletionPolicy, Storage
@@ -47,7 +47,7 @@ def create_storage(
4747
title: str = 'Storage disk',
4848
encrypted: bool = False,
4949
*,
50-
backup_rule: Optional[dict] = None,
50+
backup_rule: dict | None = None,
5151
) -> Storage:
5252
"""
5353
Create a Storage object. Returns an object based on the API's response.
@@ -70,7 +70,7 @@ def create_storage(
7070
res = self.api.post_request('/storage', body)
7171
return Storage(cloud_manager=self, **res['storage'])
7272

73-
def _modify_storage(self, storage, size, title, backup_rule: Optional[dict] = None):
73+
def _modify_storage(self, storage, size, title, backup_rule: dict | None = None):
7474
body = {'storage': {}}
7575
if size:
7676
body['storage']['size'] = size
@@ -81,7 +81,7 @@ def _modify_storage(self, storage, size, title, backup_rule: Optional[dict] = No
8181
return self.api.put_request('/storage/' + str(storage), body)
8282

8383
def modify_storage(
84-
self, storage: str, size: int, title: str, backup_rule: Optional[dict] = None
84+
self, storage: str, size: int, title: str, backup_rule: dict | None = None
8585
) -> Storage:
8686
"""
8787
Modify a Storage object. Returns an object based on the API's response.
@@ -95,9 +95,7 @@ def delete_storage(self, uuid: str, backups: BackupDeletionPolicy = BackupDeleti
9595
"""
9696
return self.api.delete_request(f'/storage/{uuid}?backups={backups.value}')
9797

98-
def clone_storage(
99-
self, storage: Union[Storage, str], title: str, zone: str, tier=None
100-
) -> Storage:
98+
def clone_storage(self, storage: Storage | str, title: str, zone: str, tier=None) -> Storage:
10199
"""
102100
Clones a Storage object. Returns an object based on the API's response.
103101
"""
@@ -203,7 +201,7 @@ def create_storage_import(
203201
def upload_file_for_storage_import(
204202
self,
205203
storage_import: StorageImport,
206-
file: Union[str, PathLike, BinaryIO],
204+
file: str | PathLike | BinaryIO,
207205
timeout: int = 30,
208206
content_type: str = 'application/octet-stream',
209207
):

upcloud_api/cloud_manager/tag_mixin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Optional
2-
31
from upcloud_api.api import API
42
from upcloud_api.tag import Tag
53

@@ -24,7 +22,7 @@ def get_tag(self, name: str) -> Tag:
2422
return Tag(cloud_manager=self, **res['tag'])
2523

2624
def create_tag(
27-
self, name: str, description: Optional[str] = None, servers: Optional[list] = None
25+
self, name: str, description: str | None = None, servers: list | None = None
2826
) -> Tag:
2927
"""
3028
Create a new Tag. Only name is mandatory.

upcloud_api/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from time import sleep
2-
from typing import TYPE_CHECKING, Any, Optional
2+
from typing import TYPE_CHECKING, Any
33

44
from upcloud_api.firewall import FirewallRule
55
from upcloud_api.ip_address import IPAddress
@@ -276,7 +276,7 @@ def remove_ip(self, ip_address: IPAddress) -> None:
276276

277277
def add_storage(
278278
self,
279-
storage: Optional[Storage] = None, # TODO: this probably shouldn't be optional
279+
storage: Storage | None = None, # TODO: this probably shouldn't be optional
280280
type: str = 'disk',
281281
address=None,
282282
) -> None:

0 commit comments

Comments
 (0)