-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
_preflight.py
33 lines (23 loc) · 940 Bytes
/
_preflight.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# type: ignore[reportUnusedFunction] # preflight use
"""
This file is inteded for manual CI/Integration usage only.
It is NOT part of the Hondana API or for public use. No support will be provided for this file. Use at your own risk.
"""
import asyncio
import pathlib
import subprocess
import sys
import hondana
TAG_PATH = pathlib.Path("./hondana/extras/tags.json")
REPORT_PATH = pathlib.Path("./hondana/extras/report_reasons.json")
client = hondana.Client()
def __update_tags() -> None:
asyncio.run(client.update_tags())
asyncio.run(client.close())
diff = subprocess.run(["git", "diff", "--exit-code", str(TAG_PATH)], capture_output=False)
sys.exit(diff.returncode)
def __update_report_reasons() -> None:
asyncio.run(client.update_report_reasons())
asyncio.run(client.close())
diff = subprocess.run(["git", "diff", "--exit-code", str(REPORT_PATH)], capture_output=False)
sys.exit(diff.returncode)