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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 EXTENSIONS = ./extensions
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='')
23 .DEFAULT_GOAL = default
24 .PHONY: clean install install-virtual docs test dist deploy
27 @echo "Please choose one of the following targets: clean, install, install-virtual, docs, test, dist, requirements.txt"
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
39 pip install --editable .[ssh]
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)"; \
48 pip install --requirement "$(DOCS)/requirements.txt"
50 sphinx-build -W -T -b html "$(DOCS)" "$(HTML)"
53 pip install --upgrade "tox>=2.7.0"
56 -e py$(PYTHON_VERSION) \
57 -e py$(PYTHON_VERSION)e2e \
58 -e py$(PYTHON_VERSION)ssh \
61 ./requirements.txt: ./requirements.in
62 pip install --upgrade "pip-tools>=1.9.0"
63 pip-compile --output-file ./requirements.txt ./requirements.in