-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmakefile
More file actions
43 lines (32 loc) · 1.21 KB
/
makefile
File metadata and controls
43 lines (32 loc) · 1.21 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
# Makefile
DATA_DIR = data
TEST_DIR = tests
TEST_DATA_DIR = $(TEST_DIR)/data
# TODO: eventually incorporate conda-lock when it is warranted
GENERATE_CONDA_LOCK = cd "$(shell dirname "$(1)")"; conda-lock -f "$(shell basename "$(2)")" -p osx-64 -p osx-arm64 -p linux-64
# NOTE: we can add any required test data files here that need to be
# generated or downloaded before running unit tests
UNIT_TEST_FILES =
# UNIT_TEST_FILES = .../unit_test_file1 .../unit_test_file2
.PHONY: install
install:
@echo "Installing kl-tools repository..."
@bash scripts/install.sh
@echo "kl-tools environment installed."
# Run tests
.PHONY: test
test: test-data
@echo "Running tests..."
@conda run -n kltools python -m unittest discover -s $(TEST_DIR) -p "test_*.py"
# Download or generate test data
.PHONY: test-data
test-data: $(UNIT_TEST_FILES)
# Regenerate the conda-lock.yaml file
conda-lock.yaml:
@echo "Regenerating $@..."
@$(call GENERATE_CONDA_LOCK,$@,environment.yaml)
#-------------------------------------------------------------------------------
# NOTE: These may be useful in the future if we use git submodules
# update-submodules:
# git submodule update --init --recursive --remote # use `branch` in .gitmodules to update
# ...