from invoke import task @task def serve_dev(c, debugger=True, reload=True, threads=True, port=8888, host="0.0.0.0"): """Serves the htmx_contact.app locally""" cmd = "flask --app ./htmx_contact/app.py run" cmd += " --debug" if debugger else "" cmd += " --reload" if reload else "" cmd += " --with-threads" if threads else "" cmd += f" --host {host}" if host else "" cmd += f" --port {port}" if port else "" print(cmd) c.run(cmd, pty=True) @task def test(c): """executes test suite""" c.run("pytest -vvv tests/", pty=True)