forked from python-discord/snekbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (38 loc) · 1.27 KB
/
Makefile
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
PIP_COMPILE_CMD = pip-compile -q -U
.PHONY: install-piptools
install-piptools:
pip install -U -q -r requirements/pip-tools.pip
.PHONY: setup
setup: install-piptools
pip-sync requirements/coverage.pip \
requirements/lint.pip \
requirements/requirements.pip
pre-commit install
.PHONY: upgrade
upgrade: install-piptools
$(PIP_COMPILE_CMD) -o requirements/requirements.pip \
--extra gunicorn --extra sentry pyproject.toml
$(PIP_COMPILE_CMD) -o requirements/coverage.pip requirements/coverage.in
$(PIP_COMPILE_CMD) -o requirements/lint.pip requirements/lint.in
$(PIP_COMPILE_CMD) -o requirements/pip-tools.pip requirements/pip-tools.in
.PHONY: lint
lint: setup
pre-commit run --all-files
# Fix ownership of the coverage file even if tests fail & preserve exit code
.PHONY: test
test:
docker compose build -q --force-rm
docker compose run --entrypoint /bin/bash --rm snekbox -c \
'coverage run -m unittest; e=$?; chown --reference=. .coverage; exit $e'
.PHONY: report
report: setup
coverage report
.PHONY: build
build:
docker build -t ghcr.io/python-development/snekbox:latest .
.PHONY: devsh
devsh:
docker compose run --entrypoint /bin/bash --rm snekbox
.PHONY: eval-deps
eval-deps:
docker compose run --rm -T --entrypoint /bin/bash snekbox scripts/install_eval_deps.sh