-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (69 loc) · 2.35 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
79
80
81
82
83
84
85
86
87
88
89
90
# Makefile to simplify some common operations.
# Find our exact Python 3 version. Override with PYTHONBIN variable before
# calling.
PYTHONBIN ?= $(shell python3-config --prefix)/bin/python3
PYVER := $(shell $(PYTHONBIN) -c 'import sys;print("{}.{}".format(sys.version_info[0], sys.version_info[1]))')
ABIFLAGS := $(shell $(PYTHONBIN)-config --abiflags)
SUFFIX := $(shell $(PYTHONBIN)-config --extension-suffix)
export PYVER
# Darwin using homebrew does not need sudo, but most other platforms do.
OSNAME = $(shell uname)
ifeq ($(OSNAME), Darwin)
SUDO =
else
SUDO = sudo
endif
GPG = gpg2
.PHONY: info build install clean distclean develop test sdist requirements docs lint bdist sign publish
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " info Show info about the Python being used."
@echo " lint to lint the source with flake8."
@echo " build to just build the packages."
@echo " install to install from this workspace."
@echo " develop to set up for local development."
@echo " test to run unit tests."
@echo " clean to clean up build artifacts."
@echo " distclean to make source tree pristine."
@echo " sdist to build source distribution."
@echo " bdist to build binary distribution (wheel)."
@echo " publish to push to PyPI."
@echo " docs to build the documention."
info:
@echo Found Python version: $(PYVER)$(ABIFLAGS)
@echo Specific Python used: $(PYTHONBIN)
@echo Python exension suffix: $(SUFFIX)
@echo sudo: $(SUDO)
lint:
$(PYTHONBIN) -m flake8 elicit/
build:
$(PYTHONBIN) setup.py build
install: build
$(PYTHONBIN) setup.py install --skip-build --optimize
requirements:
$(SUDO) $(PYTHONBIN) -m pip install -r dev-requirements.txt
develop: requirements
$(PYTHONBIN) setup.py develop --user
test:
$(PYTHONBIN) setup.py test
clean:
$(PYTHONBIN) setup.py clean
find . -depth -type d -name __pycache__ -exec rm -rf {} \;
distclean: clean
make -C docs clean
rm -rf elicit.egg-info
rm -rf dist
rm -rf build
rm -rf .cache
rm -rf .eggs
sdist: requirements
$(PYTHONBIN) setup.py sdist
bdist:
$(PYTHONBIN) setup.py bdist_wheel
sign: bdist sdist
$(GPG) --detach-sign -a dist/elicit-*.whl
$(GPG) --detach-sign -a dist/elicit-*.tar.gz
publish: sign
$(PYTHONBIN) -m twine upload -r pypi dist/*
docs:
make -C docs html