-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (65 loc) · 2.02 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
74
75
76
77
VENV = .venv
all:
# Nothing to install. Use 'make check'
exit 1
# for now, install-venv. Someday, install...
install-venv:
@if ! test -d "./$(VENV)" ; then \
echo "Running 'python3 -m venv $(VENV)'" ; \
python3 -m venv $(VENV) ; \
fi
@if test -z "$(VIRTUAL_ENV)" ; then \
echo "Installing to '$(VENV)'" ; \
. ./$(VENV)/bin/activate ; \
pip install -r ./requirements.txt . ; \
echo "\nInstalled sedg to ./$(VENV). To use, run '. ./$(VENV)/bin/activate'" ; \
else \
echo "Updating '$(VENV)'" ; \
pip install -r ./requirements.txt . ; \
echo "\nUpdated sedg in ./$(VENV)." ; \
fi
install-venv-dev:
@if ! test -d "./$(VENV)" ; then \
echo "Running 'python3 -m venv $(VENV)'" ; \
python3 -m venv $(VENV) ; \
fi
@if test -z "$(VIRTUAL_ENV)" ; then \
echo "Installing to '$(VENV)'" ; \
. ./$(VENV)/bin/activate ; \
pip install -r ./requirements_dev.txt -e . ; \
echo "\nInstalled sedg development to ./$(VENV). To use, run '. ./$(VENV)/bin/activate'" ; \
else \
echo "Updating '$(VENV)'" ; \
pip install -r ./requirements_dev.txt -e . ; \
echo "\nUpdated sedg development in ./$(VENV)." ; \
fi
test:
@if test -z "$(VIRTUAL_ENV)" ; then \
echo "WARN: not running in venv. Did you forget to '. ./$(VENV)/bin/activate'? Proceeding anyway..." ; \
fi
./tests/run-tests
syntax-check: clean
./tests/run-flake8
./tests/run-pylint
style-check: clean
./tests/run-black
style-fix: clean
black ./cvelib/*py ./tests/*py
# require woke to be installed in CI but not one local system
inclusivity-check: clean
@echo "\n# Check for non-inclusive language"; \
if test -n "$(CI)" ; then \
woke --exit-1-on-failure . ; \
elif which woke >/dev/null ; then \
woke --exit-1-on-failure . ; \
else \
echo "Could not find woke!" ; \
fi \
check: test inclusivity-check syntax-check style-check
coverage:
python3 -m coverage run ./tests/run-tests
coverage-report:
python3 -m coverage report --show-missing --omit="*/dist-packages/*"
clean:
rm -rf ./bin/__pycache__ ./cvelib/__pycache__ ./tests/__pycache__
rm -rf .coverage