-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
42 lines (31 loc) · 791 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
SHELL=/bin/bash
PYTHON_SRC_FOLDER=ammo_finder
.DEFAULT_GOAL) := run
git_files := $(shell git ls-tree --name-only -r HEAD)
python_files := $(shell find $(PYTHON_SRC_FOLDER)/ -type f -name '*.py')
.PHONY: run
run:
pipenv run $(PYTHON_SRC_FOLDER)
.PHONY: install
install: Pipfile Pipfile.lock $(python_files)
pipenv install
pipenv run pip install --editable .
.PHONY: test
test: $(git_files)
$(MAKE) install
pipenv run pytest \
--cov-report term \
--cov-report html
.PHONY: run_linting
run_linting: setup.cfg $(python_files)
$(MAKE) sort_imports
.PHONY: sort_imports
sort_imports: setup.cfg $(python_files)
pipenv run isort \
--recursive \
--virtual-env $(shell pipenv --venv) \
--project $(PYTHON_SRC_FOLDER) \
.
.PHONY: clean
clean:
rm -rf .pytest_cache *.egg-info