forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (72 loc) · 2.95 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
.PHONY: all clean develop typecheck stop build start load restart init test testmost testfast testparams docclean doc black
SHELL := /bin/bash
MAKEFILE_DIR = $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
PYTHON_VERSION := 3.6
PYTHONHASHSEED := "random"
COMPOSE_FILE := "$(MAKEFILE_DIR)/ci/docker-compose.yml"
DOCKER := docker-compose -f $(COMPOSE_FILE)
DOCKER_RUN := PYTHON_VERSION=${PYTHON_VERSION} $(DOCKER) run --rm
PYTEST_OPTIONS :=
SERVICES := omniscidb postgres waiter-postgres mysql clickhouse impala kudu-master kudu-tserver
clean:
python setup.py clean
find $(MAKEFILE_DIR) -name '*.pyc' -type f -delete
rm -rf $(MAKEFILE_DIR)/build $(MAKEFILE_DIR)/dist $(find $(MAKEFILE_DIR) -name __pycache__ -type d)
develop: clean
python setup.py develop
pre-commit install
typecheck:
@mypy --ignore-missing-imports $(MAKEFILE_DIR)/ibis
lint:
flake8
stop:
# stop all running docker compose services
$(DOCKER) rm --force --stop ${SERVICES}
build:
# build the ibis image
$(DOCKER) build --pull ibis
start:
# start all docker compose services
$(DOCKER) up --remove-orphans -d --no-build ${SERVICES}
# wait for services to start
$(DOCKER_RUN) waiter
load:
$(DOCKER_RUN) -e LOGLEVEL ibis ci/load-data.sh
restart: stop
$(MAKE) start
init: restart
$(MAKE) build
$(MAKE) load
testparallel:
PYTHONHASHSEED=${PYTHONHASHSEED} $(MAKEFILE_DIR)/ci/test.sh -n auto -m 'not udf' -k 'not test_import_time' \
--doctest-modules --doctest-ignore-import-errors ${PYTEST_OPTIONS}
test:
PYTHONHASHSEED=${PYTHONHASHSEED} $(MAKEFILE_DIR)/ci/test.sh ${PYTEST_OPTIONS} -k 'not test_import_time' \
--doctest-modules --doctest-ignore-import-errors
testmost:
PYTHONHASHSEED=${PYTHONHASHSEED} $(MAKEFILE_DIR)/ci/test.sh -n auto -m 'not (udf or impala or hdfs)' -k 'not test_import_time' \
--doctest-modules --doctest-ignore-import-errors ${PYTEST_OPTIONS}
testfast:
PYTHONHASHSEED=${PYTHONHASHSEED} $(MAKEFILE_DIR)/ci/test.sh -n auto -m 'not (udf or impala or hdfs or bigquery)' -k 'not test_import_time' \
--doctest-modules --doctest-ignore-import-errors ${PYTEST_OPTIONS}
fastopt:
@echo -m 'not (backend or bigquery or clickhouse or hdfs or impala or kudu or omniscidb or mysql or postgis or postgresql or superuser or udf)'
docclean:
$(DOCKER_RUN) ibis-docs rm -rf /tmp/docs.ibis-project.org
builddoc:
# build the ibis-docs image
$(DOCKER_RUN) build ibis ibis-docs
doc: builddoc docclean
$(DOCKER_RUN) ibis-docs ping -c 1 impala
$(DOCKER_RUN) ibis-docs git clone --branch gh-pages https://github.com/ibis-project/docs.ibis-project.org /tmp/docs.ibis-project.org --depth 1
$(DOCKER_RUN) ibis-docs find /tmp/docs.ibis-project.org \
-maxdepth 1 \
! -wholename /tmp/docs.ibis-project.org \
! -name '*.git' \
! -name CNAME \
! -name '*.nojekyll' \
-exec rm -rf {} \;
$(DOCKER_RUN) ibis-docs sphinx-build -b html docs/source /tmp/docs.ibis-project.org -W -T -j auto
black:
# check that black formatting would not be applied
black --check .