tasks.py 450 B

12345678910111213141516171819
  1. from invoke import task
  2. @task
  3. def test(c):
  4. '''Run all the provided tests'''
  5. c.run('poetry run python -m pytest tests/*.py')
  6. @task
  7. def run(c, port=8080, host='127.0.0.1'):
  8. '''Run a debug server locally'''
  9. c.run(
  10. f'poetry run python -m flask run -p {port} -h {host}',
  11. env={'FLASK_APP': 'lc/main.py'},
  12. )
  13. @task
  14. def install(c):
  15. '''Install the listed dependencies into a virtualenv'''
  16. c.run('poetry install')