-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
78 lines (53 loc) · 1.98 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
78
#iam's makefile; maybe migrate some targets to the main Makefile when done.
all: help
help:
@echo ''
@echo 'Here are the targets:'
@echo ''
@echo 'To test : "make check"'
@echo 'To develop python : "make develop"'
@echo 'To install : "make install"'
@echo 'To publish : "make publish"'
@echo 'To pylint (errors) : "make lint"'
@echo 'To pylint (all) : "make lint_all"'
@echo ''
@echo 'To check for missing docstrings : "make doc_check"'
@echo ''
PYTEST ?= $(shell which pytest)
check_pytest:
ifeq ($(PYTEST),)
$(error either you do not have pytest installed, or you need to set the env var PYTEST to your installation of pytest)
endif
check: check_pytest
$(PYTEST) -rP test_api test
#local editable install for developing
develop:
pip install -e .
iam:
python -m pip install -e .
dist: clean
python setup.py bdist_wheel
# If you need to push this project again,
# INCREASE the version number in yices/version.py,
# otherwise the server will give you an error.
publish: dist
python -m twine upload --repository pypi dist/*
install:
pip install .
clean:
rm -rf *.pyc *~ __pycache__ */*.pyc */*~ */__pycache__ */*/*.pyc */*/*~ */*/__pycache_
PYLINT = $(shell which pylint)
check_lint:
ifeq ($(PYLINT),)
$(error lint target requires pylint)
endif
lint: check_lint
# for detecting just errors:
@ $(PYLINT) -E yices_api.py yices/*.py test/*.py test_api/*.py examples/sudoku/sudoku.py
lint_all: check_lint
# for detecting more than just errors:
@ $(PYLINT) --disable=missing-docstring --disable=global-statement --disable=duplicate-code --rcfile=.pylintrc yices_api.py yices/*.py test/*.py test_api/*.py examples/sudoku/*.py
doc_check:
# a target to help me add docstrings where they are required.
@ $(PYLINT) --disable=global-statement --disable=duplicate-code --rcfile=.pylintrc yices_api.py yices/*.py
.PHONY: test lint lint_all check_lint doc_check