diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 286677f..ae64a2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ fail_fast: true repos: - repo: https://github.com/ambv/black - rev: 23.9.1 + rev: 24.4.2 hooks: - id: black language_version: python3.10 diff --git a/heimdallr/__init__.py b/heimdallr/__init__.py index 92251e6..1096201 100644 --- a/heimdallr/__init__.py +++ b/heimdallr/__init__.py @@ -9,7 +9,7 @@ from importlib_resources import files from apppath import AppPath -from warg import package_is_editable, clean_string, get_version +from warg import clean_string, get_version, package_is_editable __project__ = "Heimdallr" __author__ = "Christian Heider Nielsen" @@ -20,7 +20,6 @@ @author: cnheider """ - # __all__ = ["PROJECT_APP_PATH", "PROJECT_NAME", "PROJECT_VERSION", "get_version"] diff --git a/heimdallr/entry_points/publisher.py b/heimdallr/entry_points/publisher.py index 7a4ad7c..25054a2 100644 --- a/heimdallr/entry_points/publisher.py +++ b/heimdallr/entry_points/publisher.py @@ -13,19 +13,17 @@ from typing import Any import paho.mqtt.client as mqtt -import schedule +import schedule # TODO: USE PENDULUM INSTEAD from draugr.writers import LogWriter, MockWriter, Writer +from warg import NOD, busy_indicator, ensure_existence + +from heimdallr import PROJECT_APP_PATH, PROJECT_NAME from heimdallr.configuration.heimdallr_config import ALL_CONSTANTS from heimdallr.configuration.heimdallr_settings import ( HeimdallrSettings, SettingScopeEnum, ) from heimdallr.utilities.publisher.unpacking import pull_disk_usage_info, pull_gpu_info -from warg import NOD -from warg import busy_indicator -from warg import ensure_existence - -from heimdallr import PROJECT_APP_PATH, PROJECT_NAME __all__ = ["main"] diff --git a/heimdallr/utilities/server/github_org_generators.py b/heimdallr/utilities/server/github_org_generators.py index 4b1ee33..9a75488 100644 --- a/heimdallr/utilities/server/github_org_generators.py +++ b/heimdallr/utilities/server/github_org_generators.py @@ -7,6 +7,8 @@ Created on 29/03/2020 """ +import calendar + # https://github.com/pulls?q=is%3Aopen+is%3Apr+user%3Aaivclab+archived%3Afalse+ # https://github.com/pulls?user=aivclab from datetime import datetime, timedelta @@ -202,9 +204,6 @@ def get_pull_request(g, org_name, repo_name, pull_request_number): ) -import calendar - - def utc_to_epoch(timestamp): # Timestamp is a datetime object in UTC time """ @@ -229,5 +228,5 @@ def utc_to_epoch(timestamp): # Timestamp is a datetime object in UTC time else: print("rate limited") - print(f"reset in {timedelta(seconds = reset_seconds)} ") + print(f"reset in {timedelta(seconds=reset_seconds)} ") # print(list(yield_org_prs(gthb, 'aivclab'))) diff --git a/heimdallr/utilities/server/meet_status.py b/heimdallr/utilities/server/meet_status.py index b6b242a..b3d3463 100644 --- a/heimdallr/utilities/server/meet_status.py +++ b/heimdallr/utilities/server/meet_status.py @@ -14,13 +14,13 @@ import requests -__all__ = ["team_members_status"] +__all__ = ["meet_members_status"] from dash import html from dash.html import Div, H3, H4, H2 -def meet_members_status(access_token) -> List[html.Div]: +def meet_members_status(access_token: str) -> List[html.Div]: """ Get the status of all teams in the tenant """ @@ -57,6 +57,7 @@ def meet_members_status(access_token) -> List[html.Div]: if __name__ == "__main__": from exclude.calendar_app.tutorial.set_teams_config import s + import msal app = msal.ConfidentialClientApplication( s.teams_client_id, diff --git a/heimdallr/utilities/server/slack_status.py b/heimdallr/utilities/server/slack_status.py index b31713f..5dd8e1c 100644 --- a/heimdallr/utilities/server/slack_status.py +++ b/heimdallr/utilities/server/slack_status.py @@ -14,7 +14,7 @@ import requests -__all__ = ["team_members_status"] +__all__ = ["slack_members_status"] from dash import html from dash.html import Div, H3, H4, H2 @@ -58,6 +58,8 @@ def slack_members_status(access_token) -> List[html.Div]: if __name__ == "__main__": from exclude.calendar_app.tutorial.set_teams_config import s + import msal + app = msal.ConfidentialClientApplication( s.teams_client_id, authority=s.teams_authority, diff --git a/requirements.txt b/requirements.txt index 58dabf9..3108714 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,6 @@ fire pyfiglet schedule sorcery -setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability \ No newline at end of file +setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability +dash +plotly \ No newline at end of file