forked from ccie18643/PyTCP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (37 loc) · 1.13 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
PYTHON_VERSION := 3.10
VENV := venv
PY_PATH := $(shell find pytcp -name '*.py')
TEST_PATH := $(shell find tests -name '*.py')
all: venv
$(VENV)/bin/activate: requirements.txt
@apt-get install -y python3-venv
@python$(PYTHON_VERSION) -m venv $(VENV)
@./$(VENV)/bin/pip install -r requirements.txt
venv: $(VENV)/bin/activate
run: venv
@./$(VENV)/bin/python3 pytcp/pytcp.py
clean:
@rm -rf $(VENV)
@find . -type d -name '__pycache__' -exec rm -rf {} +
lint: venv
@echo '<<< CODESPELL'
@./$(VENV)/bin/codespell -w --ignore-words-list="ect,ether,nd,tha" --quiet-level=2 ${PY_PATH} ${TEST_PATH} README.md
@echo '<<< ISORT'
@./$(VENV)/bin/isort --profile black ${PY_PATH} ${TEST_PATH}
@echo '<<< BLACK'
@./$(VENV)/bin/black ${PY_PATH} ${TEST_PATH}
@echo '<<< FLAKE8'
@./$(VENV)/bin/flake8 ${PY_PATH} ${TEST_PATH}
@echo '<<< MYPY'
@./$(VENV)/bin/mypy -p pytcp
test: venv
@echo '<<< TESTSLIDE'
@./$(VENV)/bin/testslide tests/*.py
bridge:
@brctl addbr br0
tap:
@ip tuntap add name tap7 mode tap
@ip link set dev tap7 up
@brctl addif br0 tap7
@echo 'Interface tap7 created and added to bridge br0'
.PHONY: all venv run clean lint bridge tap