-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
83 lines (58 loc) · 2.71 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
AUTHENTICATION_PARAMS=--user $$UPLOAD_USER --token $$ANACONDA_API_TOKEN
#Needed because each command is run in a new shell
SHELL=/bin/bash
SOURCE_DIRS=mantidimaging scripts docs/ext/
CHANNELS=$(shell cat environment.yml | sed -ne '/channels:/,/dependencies:/{//!p}' | grep '^ -' | sed 's/ - / --append channels /g' | tr -d '\n')
ifeq ($(OS),Windows_NT)
XVFBRUN=
TEST_RESULT_DIR:=$(TEMP)\mantidimaging_tests
export APPLITOOLS_API_KEY=local
export APPLITOOLS_IMAGE_DIR:=${TEST_RESULT_DIR}
else
XVFBRUN=xvfb-run --auto-servernum
TEST_RESULT_DIR:=$(shell mktemp -d)
endif
install-build-requirements:
@echo "Installing packages required for starting the build process"
conda create -n build-env --yes boa anaconda-client conda-verify
conda run -n build-env conda config --env $(CHANNELS)
build-conda-package: install-build-requirements
conda run -n build-env conda mambabuild conda --label unstable
build-conda-package-nightly: .remind-for-user .remind-for-anaconda-api install-build-requirements
conda run -n build-env conda-build conda $(AUTHENTICATION_PARAMS) --label nightly
build-conda-package-release: .remind-for-user .remind-for-anaconda-api install-build-requirements
conda run -n build-env conda-build conda $(AUTHENTICATION_PARAMS)
.remind-for-user:
@if [ -z "$$UPLOAD_USER" ]; then echo "Environment variable UPLOAD_USER not set!"; exit 1; fi;
.remind-for-anaconda-api:
@if [ -z "$$ANACONDA_API_TOKEN" ]; then echo "Environment variable ANACONDA_API_TOKEN not set!"; exit 1; fi;
install-dev-requirements:
python ./setup.py create_dev_env
test:
python -m pytest -n auto --maxprocesses=4 --dist loadgroup
test-verbose:
python -m pytest -vs -o log_cli=true
test-system:
${XVFBRUN} python -m pytest -vs -rs -p no:xdist -p no:randomly -p no:repeat -p no:cov -o log_cli=true --run-system-tests mantidimaging/gui/test/
test-screenshots:
-mkdir ${TEST_RESULT_DIR}
APPLITOOLS_API_KEY=local APPLITOOLS_IMAGE_DIR=${TEST_RESULT_DIR} ${XVFBRUN} pytest -p no:xdist -p no:randomly -p no:cov mantidimaging/eyes_tests/ -vs --run-eyes-tests
@echo "Screenshots writen to" ${TEST_RESULT_DIR}
test-screenshots-win:
-mkdir ${TEST_RESULT_DIR}
${XVFBRUN} pytest -p no:xdist -p no:randomly -p no:cov mantidimaging/eyes_tests/ -vs --run-eyes-tests
@echo "Screenshots writen to" ${TEST_RESULT_DIR}
mypy:
python -m mypy --ignore-missing-imports ${SOURCE_DIRS}
pyright:
python -m pyright ${SOURCE_DIRS}
yapf:
python -m yapf --parallel --diff --recursive ${SOURCE_DIRS}
yapf_apply:
python -m yapf -i --parallel --recursive ${SOURCE_DIRS}
ruff:
ruff check ${SOURCE_DIRS}
check: ruff yapf mypy test
build-docs:
sphinx-apidoc -f -M -e -T -d 3 mantidimaging **/test **/test_helpers **/eyes_tests -o docs/api/
sphinx-build ./docs ./docs/build/html