Update project maturity status
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / src / aria / Makefile
1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements.  See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License.  You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 EXTENSIONS = ./extensions
17 DIST = ./dist
18 DOCS = ./docs
19 HTML = ./docs/html
20 EASY_INSTALL_PTH = $(VIRTUAL_ENV)/lib/python2.7/site-packages/easy-install.pth
21 PYTHON_VERSION = $$(python -V 2>&1 | cut -f2 -d' ' | cut -f1,2 -d'.' --output-delimiter='')
22
23 .DEFAULT_GOAL = default
24 .PHONY: clean install install-virtual docs test dist deploy
25
26 default:
27         @echo "Please choose one of the following targets: clean, install, install-virtual, docs, test, dist, requirements.txt"
28
29 clean:
30         rm -rf "$(DIST)" "$(HTML)" build .tox .coverage*
31         -find . -maxdepth 1 -type f -name '.coverage' -delete
32         -find . -type f -name '*.pyc' -delete
33         -find . -type d -name '__pycache__' -prune -exec rm -rf {} \; 2>/dev/null
34
35 install:
36         pip install .[ssh]
37
38 install-virtual:
39         pip install --editable .[ssh]
40         
41         # "pip install --editable" will not add our extensions to the path, so we will patch the virtualenv
42         EXTENSIONS_PATH="$$(head -n 1 "$(EASY_INSTALL_PTH)")/extensions" && \
43         if ! grep -Fxq "$$EXTENSIONS_PATH" "$(EASY_INSTALL_PTH)"; then \
44                 echo "$$EXTENSIONS_PATH" >> "$(EASY_INSTALL_PTH)"; \
45         fi
46
47 docs:
48         pip install --requirement "$(DOCS)/requirements.txt"
49         rm -rf "$(HTML)"
50         sphinx-build -W -T -b html "$(DOCS)" "$(HTML)"
51
52 test:
53         pip install --upgrade "tox>=2.7.0"
54         tox -e pylint_code \
55             -e pylint_tests \
56             -e py$(PYTHON_VERSION) \
57             -e py$(PYTHON_VERSION)e2e \
58             -e py$(PYTHON_VERSION)ssh \
59             -e docs
60
61 ./requirements.txt: ./requirements.in
62         pip install --upgrade "pip-tools>=1.9.0"
63         pip-compile --output-file ./requirements.txt ./requirements.in