Skip to content

Commit

Permalink
Uprev packages and update linting
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-vince committed Apr 4, 2024
1 parent 4cdcebc commit 65b03d5
Show file tree
Hide file tree
Showing 17 changed files with 165 additions and 177 deletions.
2 changes: 2 additions & 0 deletions grafana_dashboard_manager/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

from base64 import b64encode
from enum import Enum

Expand Down Expand Up @@ -43,6 +44,7 @@ def __init__(
Raises:
ValueError: if provided args does not satisfy the requirements of auth_type
"""
self.auth_type = auth_type
self.auth_header_prefix = auth_type.value
Expand Down
2 changes: 2 additions & 0 deletions grafana_dashboard_manager/api/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import logging

import httpx
Expand All @@ -25,6 +26,7 @@ def __init__(self, headers, auth, base_url, skip_verify, verbose):
base_url: url host
skip_verify: set to true to skip verification of https connection certs
verbose: increased logging output
"""
self.client = httpx.Client(headers=headers, auth=auth, base_url=base_url, verify=skip_verify)
self.verbose = verbose
Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/commands/dashboard_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import json
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/commands/dashboard_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import json
import logging
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import logging
from pathlib import Path
from typing import Callable, Literal
Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/grafana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

from .grafana_api import GrafanaApi, GrafanaAuthType
1 change: 1 addition & 0 deletions grafana_dashboard_manager/grafana/grafana_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import logging

from grafana_dashboard_manager.api.auth import GrafanaAuth, GrafanaAuthType
Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/handlers/api_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import json
import logging
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/handlers/api_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import logging
from typing import Type

Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/handlers/base_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import logging
from typing import Generic, TypeVar

Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

from .dashboard import DashboardFolderLookup, DashboardResponse, DashboardSearchResult, FolderDashboards
from .folder import Folder, FolderDetails
1 change: 1 addition & 0 deletions grafana_dashboard_manager/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

# ruff: noqa: D101
from typing import Literal

Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/models/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

# ruff: noqa: D101
from datetime import datetime

Expand Down
1 change: 1 addition & 0 deletions grafana_dashboard_manager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
"""

import logging
from pathlib import Path

Expand Down
306 changes: 140 additions & 166 deletions poetry.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ keywords = ["grafana", "dashboard", "json"]

[tool.poetry.dependencies]
python = "^3.11"
rich = "^13.7.0"
httpx = "^0.25.2"
pydantic = "^2.5.2"
ruff = "^0.1.9"
rich = "^13.7.1"
httpx = "^0.27.0"
pydantic = "^2.6.4"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
ruff = "^0.1.6"
pytest = "^8.1.1"
ruff = "^0.3.5"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
9 changes: 4 additions & 5 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
line-length = 120
per-file-ignores = { "__init__.py" = ["F401"] }
ignore-init-module-imports = true
extend-select = ["E501", "F401"]
select = [
lint.ignore-init-module-imports = true
lint.extend-select = ["E501", "F401"]
lint.select = [
"I", # isort
"D", # pydocstyle
"UP", # pyupgrade
"B", # flake8-bugbear
]
ignore = [
lint.ignore = [
"D100",
"D203",
"D211",
Expand Down

0 comments on commit 65b03d5

Please sign in to comment.