Skip to content

Commit

Permalink
Remove project toml file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-vince committed May 26, 2024
1 parent 2eec176 commit 6be62f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
8 changes: 4 additions & 4 deletions grafana_dashboard_manager/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
from grafana_dashboard_manager.commands import download_dashboards, upload_dashboards
from grafana_dashboard_manager.global_config import GlobalConfig
from grafana_dashboard_manager.grafana import GrafanaApi
from grafana_dashboard_manager.utils import configure_logging, parse_pyproject, show_info
from grafana_dashboard_manager.utils import configure_logging, show_info


def app():
"""Save and update Grafana dashboards via the HTTP API"""
pyproject = parse_pyproject()

parser = argparse.ArgumentParser(description=pyproject["tool"]["poetry"]["description"])
parser = argparse.ArgumentParser(
description="A cli utility that uses Grafana's HTTP API to easily save and restore dashboards."
)

# Parser for common options needed for all commands
parent_parser = argparse.ArgumentParser(add_help=False)
Expand Down
7 changes: 0 additions & 7 deletions grafana_dashboard_manager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from pathlib import Path

import rich
import tomllib
from rich.filesize import decimal
from rich.logging import RichHandler
from rich.markup import escape
Expand Down Expand Up @@ -40,12 +39,6 @@ def configure_logging(verbose: int):
logging.getLogger("httpx").setLevel(logging.WARNING)


def parse_pyproject() -> dict:
"""Returns a dict of the pyproject.toml file"""
with (Path(__file__) / ".." / "pyproject.toml").open() as file:
return tomllib.loads(file.read())


def confirm(user_prompt: str):
"""A user interactive call to confirm an action"""
should_continue = Confirm.ask(user_prompt)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "grafana_dashboard_manager"
version = "0.2.9"
version = "0.2.10"
description = "A cli utility that uses Grafana's HTTP API to easily save and restore dashboards."
authors = ["Vince Chan <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 6be62f0

Please sign in to comment.