-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (53 loc) · 1.46 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.PHONY: .
SHELL := /bin/bash
TIMER = TIMEFORMAT="This make $(MAKECMDGOALS) target took %1R seconds" && time # bash built-in, requires bash to be the SHELL above
SRC := arp_to_hosts/*.py
PYTHONPATH = export PYTHONPATH=.
all: black ci
@echo ""
@echo "ALL GOOD!"
@echo ""
ci: blackcheck typecheck pep lint test coverage
black:
@$(TIMER) black $(SRC)
blackcheck:
@$(TIMER) black --check $(SRC)
lint:
@$(PYTHONPATH) $(TIMER) pylint_runner -v --rcfile .pylintrc .
pep:
@$(TIMER) pycodestyle $(SRC)
typecheck:
@$(TIMER) mypy $(SRC)
coverage: coverage-run coverage-report
coverage-run:
@$(TIMER) coverage run --source=. -m pytest -c setup.cfg --durations=5 -vv .
@# @py.test --cov-report term-missing --cov=. .
coverage-report:
@echo
@echo
@$(TIMER) coverage report -m
test:
@$(TIMER) py.test .
run:
@$(PYTHONPATH) $(TIMER) python arp_to_hosts/arp_to_hosts.py
clean:
@rm -rf .coverage .mypy_cache .pytest_cache __pycache__ build dist *.egg-info
#
# Below this, things are only useful for wheel management
#
wheel: wheel-build wheel-install
# Builds the wheel
wheel-build:
@rm -f dist/*.whl
@python3 setup.py bdist_wheel
# Installs the wheel
wheel-install:
@python3 -m pip install --force dist/*.whl
# Uploads to pypi
wheel-push:
@python3 -m twine upload dist/*.whl
# Initializes the environment - only need to run once
init:
@python3 -m virtualenv .env
@python3 -m pip install --upgrade pip setuptools wheel tqdm twine
@python3 -m pip install -r requirements.txt