-
Notifications
You must be signed in to change notification settings - Fork 7
/
justfile
82 lines (60 loc) · 1.53 KB
/
justfile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
set dotenv-load := true
dco := "docker compose"
run := "docker compose run --rm eduzenbot"
check_env:
#!/bin/bash
if [ ! -f .env ]; then
echo "Creating .env file from .env.sample"
cp .env.sample .env
fi
os:
#!/usr/bin/env bash
echo $OSTYPE
build: check_env
#!/usr/bin/env bash
{{dco}} build
dco-version:
{{dco}} --version
dockershell:
#!/usr/bin/env bash
{{run}} eduzenbot bash
update-requirements-dev:
{{run}} pip-compile --upgrade --extra=dev pyproject.toml -o requirements-dev.txt
update-requirements-prod:
{{run}} pip-compile --upgrade pyproject.toml -o requirements.txt
update-requirements: check_env
just update-requirements-dev
just update-requirements-prod
test:
{{run}} coverage run -m pytest
logs:
{{dco}} logs -f eduzenbot
shell:
{{run}} ipython
start: check_env
{{dco}} up -d
logs
restart:
{{dco}} rm -sf eduzenbot
start
start-debug: check_env
{{dco}} run --rm --service-ports eduzenbot
install:
python -m pip install -r requirements.txt
install-dev:
python -m pip install -r requirements-dev.txt
compile:
pip-compile pyproject.toml -o requirements.txt
compile-dev:
pip-compile --extra=dev pyproject.toml -o requirements-dev.txt
format:
pre-commit run --all-files
fmt:
just format
clean:
#!/usr/bin/env python3
import pathlib, shutil
current_path = pathlib.Path('.').parent
[p.unlink() for p in current_path.rglob('*.py[co]')]
[shutil.rmtree(p) for p in current_path.rglob('__pycache__')]
[shutil.rmtree(p) for p in current_path.rglob('.pytest_cache')]