Skip to content

Commit 9cfed2b

Browse files
committed
fix tox.ini, address mypy reports
1 parent ef944f5 commit 9cfed2b

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

gooddata-pipelines/gooddata_pipelines/api/gooddata_sdk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""Interaction with GoodData Cloud via the Gooddata Python SDK."""
44

55
from pathlib import Path
6+
from typing import Callable
67

78
from gooddata_sdk.catalog.permission.declarative_model.permission import (
89
CatalogDeclarativeWorkspacePermissions,
@@ -23,8 +24,8 @@
2324
from gooddata_pipelines.api.utils import raise_with_context
2425

2526

26-
def apply_to_all_methods(decorator):
27-
def decorate(cls):
27+
def apply_to_all_methods(decorator: Callable) -> Callable:
28+
def decorate(cls: type) -> type:
2829
for attr in cls.__dict__:
2930
if callable(getattr(cls, attr)) and not attr.startswith("__"):
3031
setattr(cls, attr, decorator(getattr(cls, attr)))

gooddata-pipelines/gooddata_pipelines/backup_and_restore/backup_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def store_user_data_filters(
105105
user_data_filters: dict,
106106
export_path: Path,
107107
ws_id: str,
108-
):
108+
) -> None:
109109
"""Stores the user data filters in the specified export path."""
110110
os.mkdir(
111111
os.path.join(
@@ -136,7 +136,7 @@ def move_folder(source: Path, destination: Path) -> None:
136136
shutil.move(source, destination)
137137

138138
@staticmethod
139-
def write_to_yaml(path: str, source):
139+
def write_to_yaml(path: str, source: Any) -> None:
140140
"""Writes the source to a YAML file."""
141141
with open(path, "w") as outfile:
142142
yaml.dump(source, outfile)

gooddata-pipelines/gooddata_pipelines/backup_and_restore/storage/base_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ def __init__(self, conf: BackupRestoreConfig):
1313
self.logger = LogObserver()
1414

1515
@abc.abstractmethod
16-
def export(self, folder, org_id):
16+
def export(self, folder: str, org_id: str) -> None:
1717
"""Exports the content of the folder to the storage."""
1818
raise NotImplementedError

gooddata-pipelines/gooddata_pipelines/backup_and_restore/storage/local_storage.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ class LocalStorage(BackupStorage):
1515
def __init__(self, conf: BackupRestoreConfig):
1616
super().__init__(conf)
1717

18-
def _export(self, folder, org_id, export_folder="local_backups") -> None:
18+
def _export(
19+
self, folder: str, org_id: str, export_folder: str = "local_backups"
20+
) -> None:
1921
"""Copies the content of the folder to local storage as backup."""
2022
self.logger.info(f"Saving {org_id} to local storage")
2123
shutil.copytree(
2224
Path(folder), Path(Path.cwd(), export_folder), dirs_exist_ok=True
2325
)
2426

25-
def export(self, folder, org_id, export_folder="local_backups") -> None:
27+
def export(
28+
self, folder: str, org_id: str, export_folder: str = "local_backups"
29+
) -> None:
2630
"""Copies the content of the folder to local storage as backup."""
2731
try:
2832
self._export(folder, org_id, export_folder)

gooddata-pipelines/gooddata_pipelines/backup_and_restore/storage/s3_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _verify_connection(self) -> None:
5252
f"Failed to connect to S3 bucket {self._config.bucket}: {e}"
5353
)
5454

55-
def export(self, folder, org_id) -> None:
55+
def export(self, folder: str, org_id: str) -> None:
5656
"""Uploads the content of the folder to S3 as backup."""
5757
storage_path = f"{self._config.bucket}/{self._backup_path}"
5858
self.logger.info(f"Uploading {org_id} to {storage_path}")

gooddata-pipelines/tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# (C) 2025 GoodData Corporation
22
[tox]
3-
envlist = py3{10,11,12,13}
3+
envlist = py3{10,11,12,13}, mypy
44

55
[testenv]
66
deps =
77
pytest
88
pytest-mock
99
poetry
10-
commands = poetry run pytest
10+
commands =
11+
poetry install
12+
poetry install --extras dev
13+
poetry run pytest
1114

1215
[testenv:mypy]
1316
basepython = python3.13

0 commit comments

Comments
 (0)