-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (36 loc) · 925 Bytes
/
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
PWD=$(shell pwd)
PYTHON=python
PYLINTRC=.pylintrc
MODULE=logexp
DOCKER=docker
DOCKERFILE=$(PWD)/docker/Dockerfile.dev
DOCKER_IMAGE=logexp-dev
DOCKER_CONTAINER=logexp-dev-container
lint:
pylint --rcfile=$(PYLINTRC) $(MODULE)
mypy:
mypy $(MODULE)
test:
PYTHONPATH=$(PWD) pytest
clean: clean-pyc clean-build
clean-pyc:
rm -rf .pytest_cache
rm -rf .mypy_cache
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-build:
rm -rf build/
rm -rf dist/
rm -rf $(MODULE).egg-info/
rm -rf pip-wheel-metadata/
docker: docker-build docker-run
docker-build:
$(DOCKER) build -f $(DOCKERFILE) -t $(DOCKER_IMAGE) $(PWD)
docker-run:
$(DOCKER) run -it -v $(PWD):/work --name $(DOCKER_CONTAINER) $(DOCKER_IMAGE)
docker-attach:
$(DOCKER) attach $(DOCKER_CONTAINER)
docker-rm:
$(DOCKER) rm $(DOCKER_CONTAINER)