forked from usnistgov/CASE-Utilities-Python
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
117 lines (102 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/make -f
# Portions of this file contributed by NIST are governed by the following
# statement:
#
# This software was developed at the National Institute of Standards
# and Technology by employees of the Federal Government in the course
# of their official duties. Pursuant to Title 17 Section 105 of the
# United States Code, this software is not subject to copyright
# protection within the United States. NIST assumes no responsibility
# whatsoever for its use by other parties, and makes no guarantees,
# expressed or implied, about its quality, reliability, or any other
# characteristic.
#
# We would appreciate acknowledgement if the software is used.
SHELL := /bin/bash
top_srcdir := $(shell cd .. ; pwd)
PYTHON3 ?= python3
all: \
all-case_utils
.PHONY: \
all-case_utils \
check-case_utils \
check-doctest \
check-isomorphic_diff \
check-mypy \
download
.venv.done.log: \
$(top_srcdir)/.git_submodule_init.done.log \
$(top_srcdir)/case_utils/__init__.py \
$(top_srcdir)/setup.cfg \
$(top_srcdir)/setup.py
rm -rf venv
$(PYTHON3) -m venv \
venv
source venv/bin/activate \
&& pip install \
--upgrade \
pip \
setuptools \
wheel
source venv/bin/activate \
&& cd $(top_srcdir) \
&& pip install \
--editable \
.[testing]
touch $@
all-case_utils: \
.venv.done.log
$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory case_utils
# These check calls are provided in preferred run-order.
check: \
check-mypy \
check-doctest \
check-isomorphic_diff \
check-case_utils
source venv/bin/activate \
&& pytest \
--ignore case_utils \
--log-level=DEBUG
check-case_utils: \
.venv.done.log
$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory case_utils \
check
check-doctest: \
.venv.done.log
source venv/bin/activate \
&& pytest \
--doctest-modules \
--log-level=DEBUG \
$(top_srcdir)/case_utils
check-isomorphic_diff: \
.venv.done.log
$(MAKE) \
--directory isomorphic_diff \
check
# TODO - Add and strict-check type signatures for CASE and UCO tests.
check-mypy: \
.venv.done.log
source venv/bin/activate \
&& mypy \
--exclude case_utils/case_validate/case_test_examples/test_case_validation.py \
--exclude case_utils/case_validate/uco_test_examples/test_uco_validation.py \
--exclude venv \
--strict \
$(top_srcdir)/case_utils \
.
clean:
@$(MAKE) \
PYTHON3=$(PYTHON3) \
--directory case_utils \
clean
@rm -f \
.venv.done.log
@rm -rf \
.pytest_cache \
venv
download: \
.venv.done.log