-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
79 lines (59 loc) · 2.53 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
78
79
all: typecheck typecoverage coverageclean test coverage quality
coverageclean:
rm -fr .coverage
typecoverageclean:
rm -fr .mypy_cache
clean:
FILES=$$(find . -name \*.pyc); for f in $${FILES}; do rm $$f; done
typecheck:
mypy --cobertura-xml-report typecover --html-report typecover db_facts
typecoverage:
python setup.py mypy_ratchet
citypecoverage: typecoverage
@echo "Looking for un-checked-in type coverage metrics..."
@git status --porcelain metrics/mypy_high_water_mark
@test -z "$$(git status --porcelain metrics/mypy_high_water_mark)"
test:
ENV=test nosetests --cover-package=db_facts --with-coverage --with-xunit --cover-html --cover-xml --nocapture --cover-inclusive
citest:
ENV=test nosetests --exclude='tests/integration' --cover-package=db_facts --with-coverage --with-xunit --cover-html --cover-xml --nocapture --cover-inclusive --xunit-file=test-reports/junit.xml
@echo "Looking for un-ratcheted test coverage..."
@git status --porcelain metrics/coverage_high_water_mark
@test -z "$$(git status --porcelain metrics/coverage_high_water_mark | grep '^ M')"
coverage:
python setup.py coverage_ratchet
cicoverage: coverage
@echo "Looking for un-checked-in unit test coverage metrics..."
@git status --porcelain metrics/coverage_high_water_mark
@test -z "$$(git status --porcelain metrics/coverage_high_water_mark)"
flake8:
flake8 bluelabs_joblib tests
quality-flake8:
make QUALITY_TOOL=flake8 quality
quality-punchlist:
make QUALITY_TOOL=punchlist quality
quality-bigfiles:
make QUALITY_TOOL=bigfiles quality
quality-mdl:
make QUALITY_TOOL=mdl quality
# to run a single item, you can do: make QUALITY_TOOL=bigfiles quality
quality:
@quality_gem_version=$$(python -c 'import yaml; print(yaml.safe_load(open(".circleci/config.yml","r"))["quality_gem_version"])'); \
docker run \
-v "$$(pwd):/usr/app" \
-v "$$(pwd)/Rakefile.quality:/usr/quality/Rakefile" \
"apiology/quality:$${quality_gem_version}" ${QUALITY_TOOL}
# Note: .circleci/config.yml uses
# https://github.com/bluelabsio/circleci-quality-orb to ensure metrics
# are fully ratcheted, but this target may be useful in other contexts
ciquality: quality
@echo "Looking for any new metrics..."
@git status --porcelain metrics
@echo "Looking for un-ratcheted quality metrics..."
@test -z "$$(git status --porcelain metrics | grep '^ M')"
@echo "Looking for un-checked-in quality metrics..."
@test -z "$$(git status --porcelain metrics | grep '^??')"
package:
python3 setup.py sdist bdist_wheel
docker:
docker build --progress=plain -t db_facts .