-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (33 loc) · 1.04 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
val = $(shell jq -r $(1) $(METAJSON))
BUILD = $(call val,.build)
BUILDNUM = $(call val,.buildnum)
CHANNELS = $(addprefix -c ,$(shell tr '\n' ' ' <$(RECIPE_DIR)/channels)) -c local
METADEPS = $(RECIPE_DIR)/meta.yaml src/*/resources/info.json
METAJSON = $(RECIPE_DIR)/meta.json
NAME = $(call val,.name)
RECIPE_DIR = $(shell cd ./recipe && pwd)
TARGETS = devshell env format lint package test typecheck unittest
VERSION = $(call val,.version)
export RECIPE_DIR := $(RECIPE_DIR)
.PHONY: $(TARGETS)
all:
$(error Valid targets are: $(TARGETS))
devshell:
src/bash/condev-shell || true
env: package
conda create -y -n $(NAME)-$(VERSION)-$(BUILDNUM) $(CHANNELS) $(NAME)=$(VERSION)=$(BUILD)
format:
@./format
lint:
recipe/run_test.sh lint
meta: $(METAJSON)
package:
conda build $(CHANNELS) --error-overlinking --override-channels $(RECIPE_DIR)
test:
recipe/run_test.sh
typecheck:
recipe/run_test.sh typecheck
unittest:
recipe/run_test.sh unittest
$(METAJSON): $(METADEPS)
PYTHONPATH=$(shell cd ./src && pwd) python -m condev.meta