-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
68 lines (51 loc) · 1.67 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
VENV=env
DIST=dist
BUILD=build
BIN=$(VENV)/bin
.PHONY: docs
init:
test `command -v python3` || echo Please install python3
[ -d $(VENV) ] || python3 -m venv $(VENV)
$(BIN)/pip install -r requirements-dev.txt
$(BIN)/pre-commit install
$(BIN)/pip install -e .[snowflake,bigquery]
lint:
$(BIN)/black raster_loader setup.py
$(BIN)/flake8 raster_loader setup.py
test:
$(BIN)/pytest raster_loader --cov=raster_loader --verbose
test-integration:
$(BIN)/pytest raster_loader --cov=raster_loader --verbose --runintegration
docs:
cd docs; make clean html
test-docs:
$(BIN)/sphinx-build -a -W --keep-going docs/source/ docs/build/
publish-pypi:
rm -rf $(DIST) $(BUILD) *.egg-info
$(BIN)/python setup.py sdist bdist_wheel
$(BIN)/twine upload $(DIST)/*
publish-test-pypi:
rm -rf $(DIST) $(BUILD) *.egg-info
$(BIN)/python setup.py sdist bdist_wheel
$(BIN)/twine upload --repository-url https://test.pypi.org/legacy/ $(DIST)/* --verbose
clean:
rm -rf $(VENV) $(DIST) $(BUILD) *.egg-info
ENTER_CONTAINER:=docker-compose exec raster_loader
.PHONY: docker-build
docker-build: ## Build necessary stuff.
docker-compose build
.PHONY: docker-start
docker-start: ## Start containers with docker-compose and attach to logs.
docker-compose up --no-build
.PHONY: docker-test
docker-test: ## Enter the running backend container and run tests.
$(ENTER_CONTAINER) sh -c 'cd raster_loader && pytest $(PYTEST_FLAGS)'
.PHONY: docker-enter
docker-enter: ## Enter the backend container.
$(ENTER_CONTAINER) bash
.PHONY: docker-stop
docker-stop: ## Stop all running containers.
docker-compose stop
.PHONY: docker-remove
docker-remove: ## Remove all containers / volumes
docker-compose down --volumes