2017-05-12 00:12:57 +08:00
|
|
|
# Copyright 2017 IBM RESEARCH. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
# =============================================================================
|
2017-07-27 00:32:54 +08:00
|
|
|
.PHONY: env env-dev lint test run doc
|
2017-05-08 21:25:14 +08:00
|
|
|
|
2017-06-20 23:17:11 +08:00
|
|
|
# Dependencies need to be installed on the Anaconda virtual environment.
|
2017-05-08 21:25:14 +08:00
|
|
|
env:
|
2017-08-08 04:44:17 +08:00
|
|
|
if test $(findstring QISKitenv, $(shell conda info --envs)); then \
|
2017-10-25 22:12:04 +08:00
|
|
|
bash -c "source activate QISKitenv;pip install -r requirements.txt"; \
|
2017-08-08 04:44:17 +08:00
|
|
|
else \
|
|
|
|
conda create -y -n QISKitenv python=3; \
|
2017-10-25 22:12:04 +08:00
|
|
|
bash -c "source activate QISKitenv;pip install -r requirements.txt"; \
|
2017-08-08 04:44:17 +08:00
|
|
|
fi;
|
2017-06-20 23:17:11 +08:00
|
|
|
|
|
|
|
run:
|
2017-07-13 22:24:27 +08:00
|
|
|
bash -c "source activate QISKitenv;cd examples; cd jupyter;jupyter notebook"
|
|
|
|
|
2017-05-11 18:59:08 +08:00
|
|
|
# Ignoring generated ones with .py extension.
|
2017-05-08 21:25:14 +08:00
|
|
|
lint:
|
2017-12-29 07:41:24 +08:00
|
|
|
pylint -rn qiskit test
|
|
|
|
|
|
|
|
style:
|
|
|
|
pycodestyle --exclude=qiskit/tools --max-line-length=100 qiskit test
|
2017-05-08 21:25:14 +08:00
|
|
|
|
2018-01-05 03:21:21 +08:00
|
|
|
# Use the -s (starting directory) flag for "unittest discover" is necessary,
|
|
|
|
# otherwise the QuantumCircuit header will be modified during the discovery.
|
2017-05-09 04:17:43 +08:00
|
|
|
test:
|
2018-01-05 03:21:21 +08:00
|
|
|
python3 -m unittest discover -s test -v
|
2017-07-05 21:05:19 +08:00
|
|
|
|
|
|
|
profile:
|
2017-07-08 01:33:21 +08:00
|
|
|
python3 -m unittest discover -p "profile*.py" -v
|
2017-07-27 00:32:54 +08:00
|
|
|
|
|
|
|
doc:
|
2017-09-13 00:10:38 +08:00
|
|
|
export PYTHONPATH=$(PWD); \
|
2017-11-09 01:13:43 +08:00
|
|
|
for LANGUAGE in "." "ja"; do \
|
|
|
|
better-apidoc -f -o doc/$$LANGUAGE/_autodoc -d 5 -e -t doc/_templates/better-apidoc qiskit qiskit/tools "qiskit/extensions/standard/[a-z]*"; \
|
|
|
|
sphinx-autogen -t doc/_templates doc/$$LANGUAGE/_autodoc/*; \
|
|
|
|
make -C doc -e BUILDDIR="_build/$$LANGUAGE" -e SOURCEDIR="./$$LANGUAGE" html; \
|
|
|
|
done
|
2017-07-27 00:32:54 +08:00
|
|
|
|
2018-01-05 02:30:51 +08:00
|
|
|
sim:
|
2017-12-22 11:23:28 +08:00
|
|
|
make -C src/cpp-simulator/src clean
|
|
|
|
make -C src/cpp-simulator/src
|
2017-12-20 13:27:29 +08:00
|
|
|
|
2017-07-27 00:32:54 +08:00
|
|
|
clean:
|
|
|
|
make -C doc clean
|
2017-11-09 01:13:43 +08:00
|
|
|
make -C doc -e BUILDDIR="_build/ja" -e SOURCEDIR="./ja" clean
|
2018-01-05 02:12:59 +08:00
|
|
|
make -C src/cpp-simulator/src clean
|