You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
955 B
Python
40 lines
955 B
Python
"""
|
|
A set of `invoke` helper commands used for this project.
|
|
"""
|
|
from invoke import task
|
|
|
|
|
|
@task
|
|
def start_app(c):
|
|
"""Starts the app."""
|
|
print("Start the app")
|
|
c.run("uvicorn main:app --reload", pty=True)
|
|
|
|
|
|
@task
|
|
def run_unit_tests(c):
|
|
"""Triggers a local unittest run for the app."""
|
|
# Pytest will hide color output when it thinks it's running
|
|
# outside of a terminal therefore pty=True is used.
|
|
c.run("python3 -m pytest -vvv tests/", pty=True)
|
|
|
|
|
|
@task
|
|
def fix_eof(c):
|
|
"""Fixes any missing newlines for end of files."""
|
|
c.run("pre-commit run end-of-file-fixer --all-files", pty=True)
|
|
|
|
|
|
@task
|
|
def start_redis(c):
|
|
"""Runs the Redis integration environment."""
|
|
print("Starting Redis")
|
|
c.run("docker compose -f docker-compose-redis.yml up -d")
|
|
|
|
|
|
@task
|
|
def stop_redis(c):
|
|
"""Stops the Redis integration environent."""
|
|
print("Stopping Redis")
|
|
c.run("docker compose -f docker-compose-redis.yml down")
|