Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
strategy:
matrix:
tox_env:
- py39
- py310
- py311
- py312
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Python versions supported: 3.10, 3.11, 3.12, 3.13, PyPy3. Dropped support for 3.9.

## [2.9.0] - 2025-09-25

### Removed
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ python setup.py install

### Supported Python versions

- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tool.black]
line-length = 99
target-version = ['py39']
target-version = ['py310']
skip-string-normalization = true

[tool.ruff]
target-version = "py39"
target-version = "py310"
exclude = [
".git",
"ENV",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = MIT
license_files = []

[options]
python_requires = >=3.9, <4
python_requires = >=3.10, <4
setup_requires =
setuptools
install_requires =
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py39, py310, py311, py312, py313, pypy311
envlist = py310, py311, py312, py313, pypy311
skip_missing_interpreters = True

[testenv]
Expand Down
14 changes: 6 additions & 8 deletions upcloud_api/cloud_manager/storage_mixin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from os import PathLike
from typing import BinaryIO, Optional, Union
from typing import BinaryIO

from upcloud_api.api import API
from upcloud_api.storage import BackupDeletionPolicy, Storage
Expand Down Expand Up @@ -47,7 +47,7 @@ def create_storage(
title: str = 'Storage disk',
encrypted: bool = False,
*,
backup_rule: Optional[dict] = None,
backup_rule: dict | None = None,
) -> Storage:
"""
Create a Storage object. Returns an object based on the API's response.
Expand All @@ -70,7 +70,7 @@ def create_storage(
res = self.api.post_request('/storage', body)
return Storage(cloud_manager=self, **res['storage'])

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

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

def clone_storage(
self, storage: Union[Storage, str], title: str, zone: str, tier=None
) -> Storage:
def clone_storage(self, storage: Storage | str, title: str, zone: str, tier=None) -> Storage:
"""
Clones a Storage object. Returns an object based on the API's response.
"""
Expand Down Expand Up @@ -203,7 +201,7 @@ def create_storage_import(
def upload_file_for_storage_import(
self,
storage_import: StorageImport,
file: Union[str, PathLike, BinaryIO],
file: str | PathLike | BinaryIO,
timeout: int = 30,
content_type: str = 'application/octet-stream',
):
Expand Down
4 changes: 1 addition & 3 deletions upcloud_api/cloud_manager/tag_mixin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Optional

from upcloud_api.api import API
from upcloud_api.tag import Tag

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

def create_tag(
self, name: str, description: Optional[str] = None, servers: Optional[list] = None
self, name: str, description: str | None = None, servers: list | None = None
) -> Tag:
"""
Create a new Tag. Only name is mandatory.
Expand Down
4 changes: 2 additions & 2 deletions upcloud_api/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from time import sleep
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any

from upcloud_api.firewall import FirewallRule
from upcloud_api.ip_address import IPAddress
Expand Down Expand Up @@ -276,7 +276,7 @@ def remove_ip(self, ip_address: IPAddress) -> None:

def add_storage(
self,
storage: Optional[Storage] = None, # TODO: this probably shouldn't be optional
storage: Storage | None = None, # TODO: this probably shouldn't be optional
type: str = 'disk',
address=None,
) -> None:
Expand Down
Loading