This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
forked from google/caliban
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
77 lines (61 loc) · 1.44 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
76
77
##
# Variables
##
ENV_NAME = env
ENV_ACT = . env/bin/activate;
PIP = $(ENV_NAME)/bin/pip
PY = $(ENV_NAME)/bin/python
PYTEST_ARGS = --doctest-modules -v -s --hypothesis-profile dev
PYTEST_TARGET = caliban tests
COVERAGE_ARGS = --cov-config setup.cfg --cov-report term-missing --cov
COVERAGE_TARGET = caliban
##
# Targets
##
.PHONY: build
build: clean install
.PHONY: clean
clean: clean-env clean-files
.PHONY: clean-env
clean-env:
rm -rf $(ENV_NAME)
.PHONY: clean-files
clean-files:
rm -rf .tox
rm -rf .coverage
find . -name \*.pyc -type f -delete
find . -name \*.test.db -type f -delete
find . -depth -name __pycache__ -type d -exec rm -rf {} \;
rm -rf dist *.egg* build
.PHONY: install
install:
rm -rf $(ENV_NAME)
virtualenv -p python3 $(ENV_NAME)
$(PIP) install -r requirements-dev.txt
$(PIP) install -r docs/requirements.txt
$(PIP) install -e .
.PHONY: test
test: lint pytest
.PHONY: pytest
pytest:
$(ENV_ACT) pytest $(PYTEST_ARGS) $(COVERAGE_ARGS) $(COVERAGE_TARGET) $(PYTEST_TARGET)
.PHONY: test-full
test-full: lint test-setuppy clean-files
.PHONY: test-setuppy
test-setuppy:
$(PY) setup.py test
.PHONY: lint
lint: pre-commit
.PHONY: pre-commit
pre-commit: $(ENV_ACT) pre-commit run --all-files
.PHONY: push
push:
git push origin master
git push --tags
.PHONY: release-egg
release-egg:
$(ENV_ACT) python setup.py sdist bdist_wheel
$(ENV_ACT) twine upload -r pypi dist/*
rm -rf dist *.egg* build
.PHONY: release
release: push release-egg