-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (46 loc) · 1.08 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
POETRY_RUN := poetry run
POETRY_EXPORT := poetry export --without-hashes -f requirements.txt
SHELL := /bin/bash
.PHONY: all
all: clean install
# Installing
.make.install: poetry.lock
poetry install --no-dev
touch $@
.PHONY: install
install: .make.install
.make.install-dev: poetry.lock
poetry install
touch $@
.PHONY: install-dev
install-dev: .make.install-dev
# Virtual environment
poetry.lock: pyproject.toml
poetry lock
touch $@
requirements-dev.txt: poetry.lock
$(POETRY_EXPORT) --dev -o $@
.PHONY: up-to-date
up-to-date:
touch pyproject.toml
touch poetry.lock
touch requirements-dev.txt
touch --no-create .make.install-dev
# Testing
.PHONY: test-lint
test-lint: | .make.install-dev
$(POETRY_RUN) flake8 --config=pyproject.toml gcm tests
.PHONY: test-unit
test-unit: | .make.install-dev
$(POETRY_RUN) pytest -s --cov=gcm --cov-report=term --cov-report=xml
.PHONY: tests
tests: test-lint test-unit
.PHONY: tox
tox: | .make.install-dev
$(POETRY_RUN) tox
# Utilities
.PHONY: clean
clean:
find . | grep [py]cache | xargs rm -rf
rm -f .coverage coverage.xml .make.*
rm -rf .tox