forked from codejudas/py-proxy-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (35 loc) · 1.08 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
env_dir := env
$(env_dir): env-clean env-create env-update
@echo -e "\n===> Done! Activate environment by executing 'source $(env_dir)/bin/activate'"
.PHONY: env-create
env-create:
@echo "Building virtual env"
python3 -m venv --clear $(env_dir)
$(env_dir)/bin/pip install --upgrade --no-cache-dir pip setuptools wheel pylint
.PHONY: env-update
env-update:
$(env_dir)/bin/pip install --editable .[test]
.PHONY: nopyc
nopyc:
find . -iname '*.pyc' | xargs rm
.PHONY: env-clean
# I'm not using the env_dir variable on purpose and hardcode the name
# as 'env' to guard against accidents whereby env_dir is set to '/' for
# example
env-clean: nopyc
rm -rf env
.PHONY: lint-test
lint-test:
$(env_dir)/bin/python -m unittest tests/test_syntax.py
.PHONY: unit-test
unit-test: nopyc
$(env_dir)/bin/python -m unittest discover -s tests/unit
.PHONY: integration-test
integration-test: nopyc
$(env_dir)/bin/python -m unittest discover -s tests/integration
.PHONY: test
test: unit-test integration-test lint-test
.PHONY: test-server
test-server:
sudo pkill nginx
sudo nginx -c $(pwd)/nginx.conf