-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathMakefile
More file actions
110 lines (85 loc) · 2.37 KB
/
Makefile
File metadata and controls
110 lines (85 loc) · 2.37 KB
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
root = .
include ${root}/defs.mk
# If you want to use the install flair rather than the one in this
# tree use:
# make test use_installed_flair=yes
#
# or use
# make test-installed
#
default:
doc:
${MAKE} -C docs html
##
# test targets, the xx-installed test with the installed FLAIR rather than the
# tree.
##
.PHONY: test
test:
${MAKE} -C test test use_installed_flair=${use_installed_flair}
test-base:
${MAKE} -C test test-base use_installed_flair=${use_installed_flair}
test-installed:
${MAKE} -C test test-installed
test-base-installed:
${MAKE} -C test test-base-installed
##
# lint check with flake8
# see .flake8 for configuration
# due to to gradual cleanup of code, flake8.mk is the list of files to check
##
include flake8.mk
lint: flake8
pycbio-lint: pycbio-flake8
flake8:
${FLAKE8} --color=never ${FLAKE8_CHECK}
PYCBIO_DIR = src/flair/pycbio
pycbio-flake8:
${FLAKE8} --color=never --config=${PYCBIO_DIR}/setup.cfg ${PYCBIO_DIR}
##
# test environment for pip install
##
pip_test_env = pip_test_env
PYPI_UPLOAD_URL = https://upload.pypi.org/legacy/
PYPI_INSTALL_URL = https://pypi.org/simple/
TESTPYPI_UPLOAD_URL = https://test.pypi.org/legacy/
TESTPYPI_INSTALL_URL = https://test.pypi.org/simple/
define pip_env_setup
rm -rf ${pip_test_env}
mkdir -p ${pip_test_env}
${PYTHON} -m virtualenv --quiet ${pip_test_env}
endef
pip_env_act = source ${pip_test_env}/bin/activate
##
# release targets
##
build: clean
poetry build
# test if pip install locally
test-pip:
${pip_env_setup}
${pip_env_act} && pip install --no-cache-dir ./dist/${PACKAGE_FILE_PREFIX}-py3-none-any.whl
${pip_env_act} && ${MAKE} -C test test use_installed_flair=yes
# testpypy
publish-testpypi: build
poetry publish -r testpypi
test-testpypi:
${pip_env_setup}
${pip_env_act} && pip install --no-cache-dir --index-url=${TESTPYPI_INSTALL_URL} --extra-index-url=${PYPI_INSTALL_URL} flair-brookslab==${VERSION}
${pip_env_act} && ${MAKE} -C test test use_installed_flair=yes
# pypy
publish-pypi: build
poetry publish
test-pypi:
${pip_env_setup}
${pip_env_act} && pip install --no-cache-dir --index-url=${PYPI_INSTALL_URL} flair-brookslab==${VERSION}
${pip_env_act} && ${MAKE} -C test test use_installed_flair=yes
##
# clean targets
##
clean:
rm -rf build/ dist/ ${pip_test_env}/ src/flair/__pycache__/
cd test && ${MAKE} clean
real-clean: clean
cd test && ${MAKE} real-clean
${MAKE} -C docs clean