forked from electricitymaps/electricitymaps-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.py
More file actions
23 lines (17 loc) · 660 Bytes
/
Copy pathscripts.py
File metadata and controls
23 lines (17 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
Poetry scripts, runable using 'poetry run'.
"""
import subprocess
import sys
def _run(cmd):
assert isinstance(cmd, str)
r = subprocess.run(cmd + " ".join(sys.argv[1:]), shell=True).returncode
if r != 0:
sys.exit(r)
def lint():
_run("flake8 electricitymap tests parsers --count --select=E901,E999,F821,F822,F823 --show-source --statistics")
for path in ["tests", "electricitymap", "*.py"]:
_run(f"pylint -E {path} -d unsubscriptable-object,unsupported-assignment-operation,unpacking-non-sequence")
def test():
_run("python -u -m unittest discover tests")
_run("python -u -m unittest discover parsers/test")