-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathMakefile
65 lines (51 loc) · 1.95 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
.PHONY: install pre-build build black pycodestyle update-wiki
## @CI_actions Installs the checked out version of the code to your poetry managed venv
install:
poetry install --without dev
install-dev:
poetry install
## @CI_actions Runs code quality checks
pre-build: black unit-tests
rm setup.py || echo "There was no setup.py"
poetry show --no-dev | awk '{print "poetry add "$$1"=="$$2}' | sort | sh
## @CI_actions Builds the project into an sdist
build:
poetry build -f sdist
## @Code_quality Runs black on the checked out code
black:
poetry run black **/*.py
## @Code_quality Runs pycodestyle on the the checked out code
pycodestyle:
poetry run pycodestyle --statistics -qq uk_bin_collection
## @Testing runs unit tests
integration-tests:
# Ensure directory exists
mkdir -p build/$(matrix)/integration-test-results
# Turn off "exit on error" so we can capture the code
set +e; \
if [ -z "$(councils)" ]; then \
poetry run pytest uk_bin_collection/tests/step_defs/ \
-n logical \
--junit-xml=build/$(matrix)/integration-test-results/junit.xml; \
else \
poetry run pytest uk_bin_collection/tests/step_defs/ \
-k "$(councils)" \
-n logical \
--junit-xml=build/$(matrix)/integration-test-results/junit.xml; \
fi; \
RESULT=$$?; \
set -e; \
# Double-check that the file exists (in case of a really early crash)
if [ ! -f build/$(matrix)/integration-test-results/junit.xml ]; then \
echo "<testsuite tests='0'></testsuite>" \
> build/$(matrix)/integration-test-results/junit.xml; \
fi; \
exit $$RESULT
parity-check:
poetry run python uk_bin_collection/tests/council_feature_input_parity.py $(repo) $(branch)
unit-tests:
poetry run coverage erase
- poetry run coverage run --append --omit "*/tests/*" -m pytest -vv -s --log-cli-level=DEBUG uk_bin_collection/tests custom_components/uk_bin_collection/tests --ignore=uk_bin_collection/tests/step_defs/
poetry run coverage xml
update-wiki:
poetry run python wiki/generate_wiki.py