/
Makefile
87 lines (61 loc) · 1.75 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
sPHONY: \
all nanosim-h clean install \
test \
pylint flake8 yapf \
inc pypi sha256 \
docs readme wpypi wconda \
help
PIP=/usr/bin/env pip
PYTHON=/usr/bin/env python3
ROOT_DIR = $(shell pwd)
###############
# BASIC RULES #
###############
all:
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
$(PYTHON) setup.py clean --all
$(MAKE) -C test clean
install: ## Install nanosim-h using PIP
install:
$(PIP) uninstall -y nanosim-h || true
$(PIP) install .
###########
# TESTING #
###########
test: test_repo
test_repo: ## Run unit test & integration from the repo dir
test_repo:
$(MAKE) -C test clean
$(MAKE) -C test
pylint: ## Run PyLint
$(PYTHON) -m pylint nanosimh
flake8: ## Run Flake8
flake8
yapf: ## Run YAPF (inline replacement)
yapf -i --recursive nanosimh setup.py test
#############
# RELEASING #
#############
inc: ## Increment version
inc:
./nanosimh/increment_version.py
pypi: ## Upload nanosim-h to PyPI
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/nanosim-h 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
readme:
./update_readme_cli.py
rst2html.py README.rst > README.html
wconda: ## Open nanosim-h Bioconda webpage
open https://bioconda.github.io/recipes/nanosim-h/README.html
wpypi: ## Open nanosim-h PyPI webpage
open https://pypi.python.org/pypi/nanosim-h