-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (37 loc) · 1.19 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
.PHONY: docs test unittest resource
PYTHON := $(shell which python)
PROJ_DIR := .
DOC_DIR := ${PROJ_DIR}/docs
BUILD_DIR := ${PROJ_DIR}/build
DIST_DIR := ${PROJ_DIR}/dist
TEST_DIR := ${PROJ_DIR}/test
TESTFILE_DIR := ${TEST_DIR}/testfile
DATASET_DIR := ${TESTFILE_DIR}/dataset
SRC_DIR := ${PROJ_DIR}/hfutils
TEMPLATES_DIR := ${PROJ_DIR}/templates
RESOURCE_DIR := ${PROJ_DIR}/resource
RANGE_DIR ?= .
RANGE_TEST_DIR := ${TEST_DIR}/${RANGE_DIR}
RANGE_SRC_DIR := ${SRC_DIR}/${RANGE_DIR}
GAMES ?= arknights fgo genshin girlsfrontline azurlane
COV_TYPES ?= xml term-missing
package:
$(PYTHON) -m build --sdist --wheel --outdir ${DIST_DIR}
build:
pyinstaller -D -F $(shell python -m tools.resources) -n hfutils -c hfutils_cli.py
clean:
rm -rf ${DIST_DIR} ${BUILD_DIR} *.egg-info
rm -rf build dist hfutils.spec
test: unittest
unittest:
UNITTEST=1 \
pytest "${RANGE_TEST_DIR}" \
-sv -m unittest \
$(shell for type in ${COV_TYPES}; do echo "--cov-report=$$type"; done) \
--cov="${RANGE_SRC_DIR}" \
$(if ${MIN_COVERAGE},--cov-fail-under=${MIN_COVERAGE},) \
$(if ${WORKERS},-n ${WORKERS},)
docs:
$(MAKE) -C "${DOC_DIR}" build
pdocs:
$(MAKE) -C "${DOC_DIR}" prod