-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·67 lines (53 loc) · 1.59 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
# simple makefile to simplify repetetive build env management tasks under posix
# caution: testing won't work on windows, see README
VERSION_FILE:=VERSION
VERSION:=$(strip $(shell cat ${VERSION_FILE}))
PYPIVERSION:=$(subst _,.,$(VERSION))
pypidist:=dist/pymatreader-$(PYPIVERSION).tar.gz
condadist:=$(CONDA_PREFIX)/conda-bld/noarch/pymatreader-$(VERSION)-py_0.tar.bz2
ifeq ($(findstring dev,$(VERSION)), dev)
export TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/
ifeq ($(shell echo -n $(PYPIVERSION) | tail -c 1), v)
PYPIVERSION:=$(PYPIVERSION)0
endif
ISDEV:=1
else
ISDEV:=0
endif
flake:
@if command -v flake8 > /dev/null; then \
echo "Running flake8"; \
flake8 --count pymatreader; \
else \
echo "flake8 not found, please install it!"; \
exit 1; \
fi;
@echo "flake8 passed"
code_quality:
docker run --interactive --tty --rm --env \
CODECLIMATE_CODE="$(CURDIR)" --volume "$(CURDIR)":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze
build-doc:
cd doc; make clean; make html
autobuild-doc:
sphinx-autobuild doc/source doc/build
clean-dist:
rm -rf dist
rm -rf pymatreader.egg-info
conda-build purge-all
$(pypidist):
python setup.py sdist
$(condadist):
conda build .
make-dist: $(pypidist) $(condadist)
upload-dist: make-dist
twine upload dist/pymatreader-$(PYPIVERSION).tar.gz
ifeq ($(ISDEV), 0)
anaconda upload --force $(CONDA_PREFIX)/conda-bld/noarch/pymatreader-$(VERSION)-py_0.tar.bz2
endif
tag-release:
ifeq ($(ISDEV), 0)
git tag -a v$(VERSION) -m "version $(VERSION)"
git push origin v$(VERSION)
endif