-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
80 lines (67 loc) · 1.91 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
#
# Development by Carl J. Nobile
#
include include.mk
TODAY = $(shell date +"%Y-%m-%dT%H:%M:%S.%N%:z")
PREFIX = $(shell pwd)
BASE_DIR = $(shell echo $${PWD\#\#*/})
TEST_TAG =
PACKAGE_DIR = $(BASE_DIR)-$(VERSION)$(TEST_TAG)
DOCS_DIR = $(PREFIX)/docs
TODAY = $(shell date +"%Y-%m-%d_%H%M")
RM_REGEX = '(^.*.pyc$$)|(^.*.wsgic$$)|(^.*~$$)|(.*\#$$)|(^.*,cover$$)'
RM_CMD = find $(PREFIX) -regextype posix-egrep -regex $(RM_REGEX) \
-exec rm {} \;
PIP_ARGS =
#----------------------------------------------------------------------
all : tar
#----------------------------------------------------------------------
.PHONY : tar
tar : clean
@(cd ..; tar -czvf $(PACKAGE_DIR).tar.gz --exclude=".git" \
--exclude="example_site/static" $(BASE_DIR))
.PHONY : tests
tests : clobber
coverage erase
coverage run ./manage.py test
coverage report
coverage html
@echo $(TODAY)
.PHONY : sphinx
sphinx : clean
(cd $(DOCS_DIR); make html)
# To add a pre-release candidate such as 'rc1' to a test package name an
# environment variable needs to be set that setup.py can read.
#
# make build TEST_TAG=rc1
# make upload-test TEST_TAG=rc1
#
# The tarball would then be named dcolumn-2.0.0rc1.tar.gz
#
.PHONY : build
build : export PR_TAG=$(TEST_TAG)
build : clean
python setup.py sdist
# https://pypi.org
.PHONY : upload
upload : clobber
python setup.py sdist
python setup.py bdist_wheel --universal
twine upload --repository pypi dist/*
# https://test.pypi.org
.PHONY : upload-test
upload-test: clobber build
python setup.py bdist_wheel --universal
twine upload --repository testpypi dist/*
.PHONY : install-dev
install-dev:
pip install $(PIP_ARGS) -r requirements/development.txt
#----------------------------------------------------------------------
.PHONY : clean
clean :
$(shell $(RM_CMD))
.PHONY : clobber
clobber : clean
@rm -rf dist build *.egg-info
@rm -rf $(DOCS_DIR)/htmlcov
@rm -rf $(DOCS_DIR)/build