-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
75 lines (54 loc) · 1.9 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
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
DOCKER_IMAGE := agavepy$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
DOCKER_BUILD_ARGS ?= --force-rm
DOCKERFILE ?= dev.Dockerfile
DOCKER_MOUNT := -v "$(CURDIR)":/agavepy
DOCKER_FLAGS := docker run --rm -it $(DOCKER_MOUNT)
DOCKER_RUN_AGAVECLI := $(DOCKER_FLAGS) "$(DOCKER_IMAGE)"
.PHONY: authors build clean deps docs install shell tests
authors:
git log --format='%aN <%aE>' | sort -u --ignore-case | grep -v 'users.noreply.github.com' > AUTHORS && \
git add AUTHORS && \
git commit AUTHORS -m 'Updating AUTHORS' || true
build: # Build development container.
docker build $(DOCKER_BUILD_ARGS) -f "$(DOCKERFILE)" -t "$(DOCKER_IMAGE)" .
clean:
rm -rf agavepy.egg-info build dist .cache
rm -rf schema openapi
rm -rf agavepy/__pycache__/
rm -rf agavepy/tenants/*.pyc agavepy/tenants/__pycache__/
rm -rf agavepy/clients/*.pyc agavepy/clients/__pycache__/
rm -rf agavepy/tokens/*.pyc agavepy/tokens/__pycache__/
rm -rf agavepy/files/*.pyc agavepy/files/__pycache__/
rm -rf agavepy/utils/*.pyc agavepy/utils/__pycache__/
rm -rf agavepy/tests/__pycache__/
rm -rf agavepy/*.pyc
rm -rf tests/__pycache__/
rm -rf tests/*.pyc
rm -rf .pytest_cache/
clean-docs:
make -C docs/ clean
docs:
python scripts/swagger_to_rst.py
pip install -q "sphinx-rtd-theme>=0.4.0"
make -C docs/ html
install:
python setup.py install
install-py2:
python2 setup.py install
shell: build # Start a shell inside the build environment.
$(DOCKER_RUN_AGAVECLI) bash
tests:
pytest -vv --cache-clear tests/
tests-py2:
python2 -m pytest -vv tests
.PHONY: format format-code format-tests
format: format-code format-tests
format-code:
yapf --recursive --style pep8 -i agavepy
format-tests:
yapf --recursive --style pep8 -i tests
release: clean
python setup.py sdist bdist_wheel
twine upload dist/*