-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathMakefile
138 lines (108 loc) · 4.73 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.PHONY: clean-all clean clean-eggs clean-build clean-pyc clean-test-containers clean-test \
clean-docs lint smoke test test-all test-images test-rpm docker-images coverage docs \
open-docs release release-builds dist dist-online dist-offline wheel install precommit
help:
@echo "precommit - run \`quick' tests and tasks that should pass or succeed prior to pushing"
@echo "clean-all - clean everything; effectively resets repo as if it was just checked out"
@echo "clean - remove build, test, coverage and Python artifacts except for the cache Presto RPM"
@echo "clean-eggs - remove *.egg and *.egg-info files and directories"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test-containers - remove Docker containers used during tests"
@echo "clean-test - remove test and coverage artifacts"
@echo "clean-docs - remove doc artifacts"
@echo "lint - check style with flake8"
@echo "smoke - run tests annotated with attr smoke using nosetests"
@echo "test - run tests quickly with Python 2.6 and 2.7"
@echo "test-all - run tests on every Python version with tox. Specify TEST_SUITE env variable to run only a given suite."
@echo "test-images - create product test image(s). Specify IMAGE_NAMES env variable to create only certain images."
@echo "test-rpm - run tests for the RPM package"
@echo "docker-images - pull docker image(s). Specify DOCKER_IMAGE_NAME env variable for specific image."
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "open-docs - open the root document (index.html) using xdg-open"
@echo "release - package and upload a release"
@echo "release-builds - run all targets associated with a release (clean-build clean-pyc dist dist-online docs)"
@echo "dist - package and build installer that requires an Internet connection"
@echo "dist-online - package and build installer that requires an Internet connection"
@echo "dist-offline - package and build installer that does not require an Internet connection"
@echo "wheel - build wheel only"
@echo "install - install the package to the active Python's site-packages"
precommit: clean dist lint docs test
clean-all: clean
rm -f presto*.rpm
clean: clean-build clean-pyc clean-test clean-eggs clean-docs
clean-eggs:
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -type f -exec rm -rf {} +
find . -name '*.egg' -type d -exec rm -rf {} +
clean-build:
rm -fr build/
rm -fr dist/
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test-containers:
for c in $$(docker ps --format "{{.ID}} {{.Image}}" | awk '/teradatalabs\/pa_test/ { print $$1 }'); do docker kill $$c; done
clean-test:
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr tmp
for image in $$(docker images | awk '/teradatalabs\/pa_test/ {print $$1}'); do docker rmi -f $$image ; done
@echo "\n\tYou can kill running containers that caused errors removing images by running \`make clean-test-containers'\n"
clean-docs:
rm -rf docs/prestoadmin.*
rm -f docs/modules.rst
rm -rf docs/_build
lint:
flake8 prestoadmin packaging tests
presto-server-rpm.rpm:
wget 'https://repository.sonatype.org/service/local/artifact/maven/content?r=central-proxy&g=com.facebook.presto&a=presto-server-rpm&e=rpm&v=RELEASE' -O $@
smoke: clean-test docker-images
tox -e py26 -- -a smoketest,'!quarantine'
test: clean-test
tox -- -s tests.unit
tox -- -s tests.integration
TEST_SUITE?=tests.product
test-all: clean-test docker-images
tox -- -s tests.unit
tox -- -s tests.integration
tox -e py26 -- -s ${TEST_SUITE} -a '!quarantine'
IMAGE_NAMES?="all"
test-images: docker-images presto-server-rpm.rpm
python tests/product/image_builder.py ${IMAGE_NAMES}
docker-images:
docker pull teradatalabs/centos6-ssh-oj8
test-rpm: clean-test test-images
tox -e py26 -- -s tests.rpm -a '!quarantine'
coverage:
coverage run --source prestoadmin setup.py test -s tests.unit
coverage report -m
coverage html
echo `pwd`/htmlcov/index.html
docs: clean-docs
sphinx-apidoc -o docs/ prestoadmin
$(MAKE) -C docs clean
$(MAKE) -C docs html
open-docs:
xdg-open docs/_build/html/index.html
release: clean
python setup.py sdist upload -r pypi_internal
python setup.py bdist_wheel upload -r pypi_internal
release-builds: clean-build clean-pyc dist dist-offline docs
dist: dist-online
dist-online: clean-build clean-pyc
python setup.py bdist_prestoadmin --online-install
ls -l dist
dist-offline: clean-build clean-pyc
python setup.py bdist_prestoadmin
ls -l dist
wheel: clean
python setup.py bdist_wheel
ls -l dist
install: clean
python setup.py install