-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (75 loc) · 2.09 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
91
92
93
94
95
96
97
98
99
100
101
102
103
.PHONY: \
all clean install \
test \
pylint flake8 format \
inc pypi sha256 \
docs readme wpypi wconda \
deppip depconda \
help
PIP=/usr/bin/env pip
PYTHON=/usr/bin/env python3
ROOT_DIR = $(shell pwd)
###############
# BASIC RULES #
###############
all:
help: ## Print help messages
@echo -e "$$(grep -hE '^\S*(:.*)?##' $(MAKEFILE_LIST) \
| sed \
-e 's/:.*##\s*/:/' \
-e 's/^\(.*\):\(.*\)/ \\x1b[36m\1\\x1b[m:\2/' \
-e 's/^\([^#]\)/\1/g' \
-e 's/: /:/g' \
-e 's/^#\(.*\)#/\\x1b[90m\1\\x1b[m/' \
| column -c2 -t -s : )"
clean: ## Clean
$(PYTHON) setup.py clean --all
rm -fr _index_test/ _test_*
$(MAKE) -C attotree clean
$(MAKE) -C tests clean
install: ## Install using PIP
install: hooks
$(PIP) uninstall -y attotree || true
$(PIP) install .
###########
# TESTING #
###########
test: ## Run tests
$(MAKE) -C tests clean
$(MAKE) -C tests
pylint: ## Run PyLint
$(PYTHON) -m pylint attotree
flake8: ## Run Flake8
flake8
format: ## Run YAPF (inline replacement)
yapf -i --recursive attotree setup.py tests
#############
# RELEASING #
#############
inc: ## Increment version
inc:
./attotree/increment_version.py
pypi: ## Upload to PyPI
pypi:
$(MAKE) clean
$(PYTHON) setup.py sdist bdist_wheel
$(PYTHON) -m twine upload dist/*
sha256: ## Compute sha256 for the PyPI package
sha256:
s=$$(curl https://pypi.python.org/pypi/attotree 2>/dev/null| perl -pe 's/#/\n/g' | grep -o 'https.*\.tar\.gz' | xargs curl -L 2>/dev/null | shasum -a 256 | awk '{print $$1;}'); echo $$s; echo $$s | pbcopy
#######################
# DOCUMENTATION & WEB #
#######################
readme: ## Convert README to HTML
rst2html.py README.rst > README.html
wconda: ## Open Bioconda webpage
open https://bioconda.github.io/recipes/attotree/README.html
wpypi: ## Open PyPI webpage
open https://pypi.python.org/pypi/attotree
########################
# INSTALL DEPENDENCIES #
########################
depconda: ## Install dependencies using Conda
cat requirements.txt | perl -pe 's/==.*//g' | xargs conda install
deppip: ## Install dependencies using PIP
cat requirements.txt | xargs $(PIP) install