-
Notifications
You must be signed in to change notification settings - Fork 76
/
Makefile
51 lines (40 loc) · 2.09 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
48
49
50
51
# Makefile for CodeJail
.PHONY: clean dev-requirements quality requirements test test_no_proxy \
test_proxy upgrade upgrade
clean:
find codejail -name '*.pyc' -exec rm -f {} +
find codejail -name '*.pyo' -exec rm -f {} +
find codejail -name '__pycache__' -exec rm -rf {} +
test: test_no_proxy test_proxy
test_no_proxy:
@echo "Running all tests with no proxy process"
CODEJAIL_PROXY=0 pytest --junitxml=reports/pytest-no-proxy.xml --log-level=DEBUG
test_proxy:
@echo "Running all tests with proxy process"
CODEJAIL_PROXY=1 pytest --junitxml=reports/pytest-proxy.xml --log-level=DEBUG
COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)"
upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: $(COMMON_CONSTRAINTS_TXT)
## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -q -r requirements/pip_tools.txt
pip-compile --allow-unsafe --rebuild --annotation-style=line --upgrade -o requirements/pip.txt requirements/pip.in
pip-compile --annotation-style=line --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
pip install -q -r requirements/pip.txt
pip install -q -r requirements/pip_tools.txt
pip-compile --annotation-style=line --upgrade -o requirements/tox.txt requirements/tox.in
pip-compile --annotation-style=line --upgrade -o requirements/testing.txt requirements/testing.in
pip-compile --annotation-style=line --upgrade -o requirements/sandbox.txt requirements/sandbox.in
pip-compile --annotation-style=line --upgrade -o requirements/development.txt requirements/development.in
quality: ## check coding style with pycodestyle and pylint
pycodestyle codejail *.py
isort --check-only --diff codejail *.py
pylint codejail *.py
isort: ## apply automatic import sorting
isort --recursive codejail *.py
requirements: dev-requirements
dev-requirements:
pip install -r requirements/sandbox.txt
pip install -r requirements/development.txt