Skip to content

Commit

Permalink
chore: switch from grafana_api to grafana_client
Browse files Browse the repository at this point in the history
+ upgrade everything

Refs: m0nhawk/grafana_api#88
  • Loading branch information
tewfik-ghariani committed Feb 8, 2022
1 parent 896265c commit f3cf5d4
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 224 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
- name: Nix
uses: cachix/install-nix-action@v12
uses: cachix/install-nix-action@v16
- name: Parsing
run: 'find . -name "*.nix" -exec nix-instantiate --parse --quiet {} >/dev/null +'
env:
NIX_PATH: "nixpkgs=channel:nixos-20.09"
NIX_PATH: "nixpkgs=channel:nixos-21.11"
black:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
- name: Nix
uses: cachix/install-nix-action@v12
uses: cachix/install-nix-action@v16
- name: Black
run: 'nix-shell ./shell.nix --run "black --check ."'
env:
NIX_PATH: "nixpkgs=channel:nixos-20.09"
NIX_PATH: "nixpkgs=channel:nixos-21.11"
mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
- name: Nix
uses: cachix/install-nix-action@v12
uses: cachix/install-nix-action@v16
- name: Mypy
run: 'nix-shell ./shell.nix --run "mypy nixops_grafana"'
env:
NIX_PATH: "nixpkgs=channel:nixos-20.09"
NIX_PATH: "nixpkgs=channel:nixos-21.11"
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
- name: Nix
uses: cachix/install-nix-action@v12
uses: cachix/install-nix-action@v16
- name: Build
run: 'nix-build -I nixpkgs=channel:nixos-20.09 --quiet release.nix -A nixops-grafana.x86_64-linux'
run: 'nix-build -I nixpkgs=channel:nixos-21.11 --quiet release.nix -A nixops-grafana.x86_64-linux'
env:
NIX_PATH: "nixpkgs=channel:nixos-20.09"
NIX_PATH: "nixpkgs=channel:nixos-21.11"
5 changes: 4 additions & 1 deletion setup.cfg → mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[mypy-grafana_api.*]
[mypy]
warn_unused_configs = True

[mypy-grafana_client.*]
ignore_missing_imports = True

[mypy-grafanalib.*]
Expand Down
4 changes: 2 additions & 2 deletions nixops_grafana/grafana_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Union,
Tuple,
)
from grafana_api.grafana_face import GrafanaFace
from grafana_client import GrafanaApi


def connect(
Expand All @@ -22,5 +22,5 @@ def connect(
# API token
token = auth

grafana_api = GrafanaFace(auth=token, host=host, protocol=protocol)
grafana_api = GrafanaApi(auth=token, host=host, protocol=protocol)
return grafana_api
2 changes: 1 addition & 1 deletion nixops_grafana/resources/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import json

from grafana_api.grafana_api import (
from grafana_client.client import (
GrafanaBadInputError,
GrafanaClientError,
GrafanaServerError,
Expand Down
2 changes: 1 addition & 1 deletion nixops_grafana/resources/grafana_folder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from grafana_api.grafana_api import (
from grafana_client.client import (
GrafanaBadInputError,
GrafanaClientError,
)
Expand Down
Loading

0 comments on commit f3cf5d4

Please sign in to comment.