invoke/poetry: updated version in toml file and added invoke commands

This commit is contained in:
Blake Harnden 2020-07-07 23:38:12 -07:00
parent 3949bd6d1b
commit fb21909dad
2 changed files with 46 additions and 8 deletions

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "core"
version = "6.4.0"
version = "6.6.0"
description = ""
authors = []

View file

@ -2,13 +2,51 @@ from invoke import task
@task
def core(c):
def daemon(c):
"""
Runs core-daemon.
"""
with c.cd("daemon"):
poetry = c.run("which poetry").stdout.strip()
c.run(
"poetry run sudo python3 scripts/core-daemon "
f"sudo {poetry} run scripts/core-daemon "
"-f data/core.conf -l data/logging.conf"
)
@task
def core_pygui(c):
c.run("poetry run python3 scripts/core-pygui")
def gui(c):
"""
Run core-pygui.
"""
with c.cd("daemon"):
c.run("poetry run scripts/core-pygui")
@task
def test(c):
"""
Run core tests.
"""
with c.cd("daemon"):
poetry = c.run("which poetry").stdout.strip()
c.run(f"sudo {poetry} run pytest -v --lf -x tests", pty=True)
@task
def test_mock(c):
"""
Run core tests using mock to avoid running as sudo.
"""
with c.cd("daemon"):
c.run("poetry run pytest -v --mock --lf -x tests", pty=True)
@task
def test_emane(c):
"""
Run core emane tests.
"""
with c.cd("daemon"):
poetry = c.run("which poetry").stdout.strip()
c.run(f"sudo {poetry} run pytest -v --lf -x tests/emane", pty=True)