-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
56 lines (37 loc) · 1.09 KB
/
tasks.py
File metadata and controls
56 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
from invoke import task
PYTHON_TAG = os.environ.get("PYTHON_TAG", "3.11-alpine")
@task
def ensure_images(c):
"""Prepare docker images"""
images = [
"rabbitmq:3-management",
]
for image in images:
c.run(f"docker pull {image}")
@task
def run_linters(c):
"""Run linters"""
cmd = "poetry run ruff check rmqaio"
c.run(cmd)
@task
def run_tests(c):
"""Run tests"""
cmd = (
"poetry run coverage run --data-file=artifacts/.coverage --source rmqaio "
"-m pytest -v --maxfail=1 tests/ && "
"poetry run coverage json --data-file=artifacts/.coverage -o artifacts/coverage.json && "
"poetry run coverage report --data-file=artifacts/.coverage -m"
)
c.run(cmd)
@task
def build_docs(c):
"""Build documentation."""
cmd = "poetry run mkdocs build -f docs/mkdocs.yml"
c.run(cmd)
@task
def run_docs(c):
"""Run local HTTP server with documentation on http://localhost:8000."""
cmd = "poetry run python -m http.server -d docs/site"
print("Serving on http://localhost:8000...")
c.run(cmd)