view tasks.py @ 81:8d3c3e7cfb54

(barely) runnable demo service instance
author drewp@bigasterisk.com
date Mon, 04 Apr 2022 11:25:05 -0700
parents 22c9679dbf67
children 8a9f8dc65da8
line wrap: on
line source

from invoke import task

import sys
sys.path.append('/my/proj/release')
from release import local_release


@task
def release(ctx):
    local_release(ctx)


@task
def test(ctx):
    test_forever(ctx, forever=False)


@task
def test_forever(ctx, forever=True):
    watchdir = 'rdfdb'
    testdir = 'rdfdb'
    ctx.run(f'pdm run pytest {testdir}', pty=True)  # ptw doesn't do an initial run
    if forever:
        ctx.run(f'pdm run ptw {watchdir} {testdir}', pty=True)


@task
def demo(ctx):
    ctx.run('PYTHONPATH=. pdm run python3 rdfdb/service.py -v', pty=True)