Beam-Connectivity / grafana-dashboard-manager

Import and export Grafana dashboards for backup and dynamic provisioning
MIT License
58 stars 12 forks source link

Unable to install #2

Closed dtrckd closed 2 years ago

dtrckd commented 2 years ago

Hi, This package seems great but I was unable to install it succesfully.

With poetry I got this error :

.poetry/bin/poetry run pip install grafana-dashboard-manager

  RuntimeError

  Poetry could not find a pyproject.toml file in /home/dtrckd or its parents

  at .poetry/lib/poetry/_vendor/py3.9/poetry/core/factory.py:369 in locate
      365│             if poetry_file.exists():
      366│                 return poetry_file
      367│ 
      368│         else:
    → 369│             raise RuntimeError(
      370│                 "Poetry could not find a pyproject.toml file in {} or its parents".format(
      371│                     cwd
      372│                 )
      373│             )

And with pip, it got installed, but can't execute with the following error

grafana-dashboard-manager     
Traceback (most recent call last):
  File "/home/dtrckd/.local/bin/grafana-dashboard-manager", line 5, in <module>
    from grafana_dashboard_manager.__main__ import app
  File "/home/dtrckd/.local/lib/python3.9/site-packages/grafana_dashboard_manager/__main__.py", line 21, in <module>
    import grafana_dashboard_manager.dashboard_upload
  File "/home/dtrckd/.local/lib/python3.9/site-packages/grafana_dashboard_manager/dashboard_upload.py", line 29, in <module>
    REPO = git.Repo(search_parent_directories=True)
  File "/home/dtrckd/.local/lib/python3.9/site-packages/git/repo/base.py", line 224, in __init__
    self.working_dir: Optional[PathLike] = self._working_tree_dir or self.common_dir
  File "/home/dtrckd/.local/lib/python3.9/site-packages/git/repo/base.py", line 307, in common_dir
    raise InvalidGitRepositoryError()
git.exc.InvalidGitRepositoryError

Any hints how to solve this ?

chan-vince commented 2 years ago

The readme docs for installation are wrong - poetry run should be omitted if you install from pip:

pip install grafana-dashboard-manager

Give that a go and let me know if it works. Thanks for raising this - I'll fix the docs!

dtrckd commented 2 years ago

Yes, I think I did it right.

I tried to install it with pip first, and then executed the command as is. I got the error above. I then tried to install it with poetry and got the other runtime error.

Does it make sense ?

chan-vince commented 2 years ago

The git runtime issue has been fixed recently - please try updating to 0.1.3:

pip install grafana-dashboard-manager --upgrade
dtrckd commented 2 years ago

You right, it worked. A dependency conflict during the first go (typer 4) made it installed version 0.1.2.

Thanks.