-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
109 lines (74 loc) · 2.15 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
104
105
106
107
108
#
# Author: Karel Brinda <[email protected]>
#
# License: MIT
#
.PHONY: \
all clean cleanall install \
test \
pylint flake8 yapf \
inc pypi sha256 \
docs readme wpypi wconda \
deppip depconda \
help
PIP=/usr/bin/env pip
PYTHON=/usr/bin/env python3
ROOT_DIR = $(shell pwd)
SHELL=/usr/bin/env bash -eo pipefail
SM=snakemake -j -p
.SECONDARY:
.SUFFIXES:
###############
# BASIC RULES #
###############
all: ## Run everything
help: ## Print help message
@echo "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s : | sort)"
clean: ## Clean
make -C pipeline clean
cleanall: ## Clean all files (including bam files and logs)
cleanall: clean
make -C pipeline cleanall
install: ## Install using PIP
install:
$(PIP) uninstall -y rase || true
$(PIP) install .
###########
# TESTING #
###########
test: ## Run tests
$(MAKE) -C tests clean
$(MAKE) -C tests
pylint: ## Run PyLint
$(PYTHON) -m pylint rase
flake8: ## Run Flake8
flake8
yapf: ## Run YAPF (inline replacement)
yapf -i --recursive src setup.py tests
#############
# RELEASING #
#############
inc: ## Increment version
./src/rase/increment_version.py
pypi: ## Upload to PyPI
$(MAKE) clean
$(PYTHON) setup.py sdist bdist_wheel upload
sha256: ## Compute sha256 for the PyPI package
sha256:
s=$$(curl https://pypi.python.org/pypi/rase 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: ## Generate readme.html
markdown_py readme.md > readme.html
wconda: ## Open Bioconda webpage
open https://bioconda.github.io/recipes/rase/README.html
wpypi: ## Open PyPI webpage
open https://pypi.python.org/pypi/rase
########################
# 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