Skip to content

Chore(deps-dev): Update ruff requirement from <0.9 to <0.10 #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2025
Merged
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
3 changes: 1 addition & 2 deletions examples/datasource-health-probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def ensure_datasource(grafana: GrafanaApi, datasource: DatasourceModel):
datasource = grafana.datasource.update_datasource(datasource_existing["id"], datasource)["datasource"]
else:
logger.error(
f"Failed to create or update data source '{datasource}'. "
f"Reason: {ex.message}. Response: {ex.response}"
f"Failed to create or update data source '{datasource}'. Reason: {ex.message}. Response: {ex.response}"
)
raise
return datasource
Expand Down
2 changes: 1 addition & 1 deletion grafana_client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def from_env(cls, timeout: Union[float, Tuple[float, float]] = None):
timeout = float(os.environ["GRAFANA_TIMEOUT"])
except Exception as ex:
raise ValueError(
f"Unable to parse invalid `float` value from " f"`GRAFANA_TIMEOUT` environment variable: {ex}"
f"Unable to parse invalid `float` value from `GRAFANA_TIMEOUT` environment variable: {ex}"
)
if timeout is None:
timeout = DEFAULT_TIMEOUT
Expand Down
4 changes: 2 additions & 2 deletions grafana_client/elements/_async/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ async def get_dashboards_tags(self):

async def get_dashboard_permissions(self, dashboard_id):
warnings.warn(
"get_dashboard_permissions is deprecated, " "use corresponding _by_id or _by_uid methods",
"get_dashboard_permissions is deprecated, use corresponding _by_id or _by_uid methods",
DeprecationWarning,
)
return self.get_permissions_by_id(dashboard_id)

async def update_dashboard_permissions(self, dashboard_id, items):
warnings.warn(
"update_dashboard_permissions is deprecated, " "use corresponding _by_id or _by_uid methods",
"update_dashboard_permissions is deprecated, use corresponding _by_id or _by_uid methods",
DeprecationWarning,
)
return self.update_permissions_by_id(dashboard_id, items)
Expand Down
4 changes: 2 additions & 2 deletions grafana_client/elements/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ def get_dashboards_tags(self):

def get_dashboard_permissions(self, dashboard_id):
warnings.warn(
"get_dashboard_permissions is deprecated, " "use corresponding _by_id or _by_uid methods",
"get_dashboard_permissions is deprecated, use corresponding _by_id or _by_uid methods",
DeprecationWarning,
)
return self.get_permissions_by_id(dashboard_id)

def update_dashboard_permissions(self, dashboard_id, items):
warnings.warn(
"update_dashboard_permissions is deprecated, " "use corresponding _by_id or _by_uid methods",
"update_dashboard_permissions is deprecated, use corresponding _by_id or _by_uid methods",
DeprecationWarning,
)
return self.update_permissions_by_id(dashboard_id, items)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ develop =
build<2
poethepoet<1
pip-review<2 # Use `pip-review --local --interactive` to upgrade outdated packages.
ruff<0.9;python_version>='3.7'
ruff<0.10;python_version>='3.7'
twine<7


Expand Down
8 changes: 4 additions & 4 deletions test/elements/test_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,20 @@ def test_get_snapshot_by_key(self, m):
def test_delete_snapshot_by_key(self, m):
m.delete(
"http://localhost/api/snapshots/YYYYYYY",
json={"message": "Snapshot deleted. It might take an hour " "before it's cleared from any CDN " "caches."},
json={"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."},
)
annotation = self.grafana.snapshots.delete_snapshot_by_key(snapshot_id="YYYYYYY")
self.assertEqual(
annotation["message"], "Snapshot deleted. It might take an hour before it's cleared from any " "CDN caches."
annotation["message"], "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."
)

@requests_mock.Mocker()
def test_delete_snapshot_by_delete_key(self, m):
m.get(
"http://localhost/api/snapshots-delete/XXXXXXX",
json={"message": "Snapshot deleted. It might take an hour " "before it's cleared from any CDN " "caches."},
json={"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."},
)
annotation = self.grafana.snapshots.delete_snapshot_by_delete_key(snapshot_delete_key="XXXXXXX")
self.assertEqual(
annotation["message"], "Snapshot deleted. It might take an hour before it's cleared from any " "CDN caches."
annotation["message"], "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."
)
Loading