forked from qiskit-community/qiskit-aqua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (59 loc) · 2.11 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
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
OS := $(shell uname -s)
ifeq ($(OS), Linux)
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
else ifeq ($(OS), Darwin)
NPROCS := 2
else
NPROCS := 0
endif # $(OS)
ifeq ($(NPROCS), 2)
CONCURRENCY := 2
else ifeq ($(NPROCS), 1)
CONCURRENCY := 1
else ifeq ($(NPROCS), 3)
CONCURRENCY := 3
else ifeq ($(NPROCS), 0)
CONCURRENCY := 0
else
CONCURRENCY := $(shell echo "$(NPROCS) 2" | awk '{printf "%.0f", $$1 / $$2}')
endif
# You can set this variable from the command line.
SPHINXOPTS =
.PHONY: lint mypy style test test_ci spell copyright html doctest coverage coverage_erase
all_check: spell style lint copyright mypy html doctest
lint:
pylint -rn --ignore=gauopen qiskit/aqua qiskit/chemistry qiskit/finance qiskit/ml qiskit/optimization test tools
mypy:
mypy qiskit test tools
style:
pycodestyle qiskit/aqua qiskit/chemistry qiskit/finance qiskit/ml qiskit/optimization test tools
test:
python -m unittest discover -v test
test_ci:
echo "Detected $(NPROCS) CPUs running with $(CONCURRENCY) workers"
stestr run --concurrency $(CONCURRENCY)
spell:
pylint -rn --disable=all --enable=spelling --spelling-dict=en_US --spelling-private-dict-file=.pylintdict --ignore=gauopen qiskit/aqua qiskit/chemistry qiskit/finance qiskit/ml qiskit/optimization test tools
copyright:
python tools/check_copyright_year.py
html:
make -C docs html SPHINXOPTS=$(SPHINXOPTS)
doctest:
make -C docs doctest SPHINXOPTS=$(SPHINXOPTS)
coverage:
coverage3 run --source qiskit/aqua,qiskit/chemistry,qiskit/finance,qiskit/ml,qiskit/optimization --omit */gauopen/* -m unittest discover -s test -q
coverage3 report
coverage_erase:
coverage erase
clean: coverage_erase ;