-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
70 lines (53 loc) · 2.01 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
.PHONY: all
# https://stackoverflow.com/questions/53382383/makefile-cant-use-conda-activate
# Need to specify bash in order for conda activate to work.
SHELL=/bin/bash
# Note that the extra activate is needed to ensure that the activate floats env to the front of PATH
CONDA_ACTIVATE=source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda activate
CONDA_ENV_NAME=rele-zoo
PROJECT_PATH=relezoo
install-env:
conda env create -f environment.yaml
update-env:
conda env update -n rele-zoo -f environment.yaml
install-dev:
touch setup.cfg
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pip install -e ".[dev]")
rm setup.cfg
install:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pip install .)
clean: clean-pyc clean-test clean-misc
clean-misc:
rm -rf .benchmarks
rm report.xml || true
rm coverage.xml || true
rm .coverage || true
rm -rf outputs || true
rm -rf relezoo.egg-info || true
rm -rf .pytest_cache || true
rm -rf tensorboard || true
rm -rf checkpoints || true
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test:
rm -rf .coverage
rm -rf .pytest_cache
rm -rf .mypy_cache
typing:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pytest -v -s --mypy ${PROJECT_PATH} tests)
lint:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; flake8 --output-file=flake8.txt || true)
test:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pytest --junitxml=report.xml -v -s --cov=${PROJECT_PATH} tests; coverage xml)
test-unit:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pytest -m unit --junitxml=report.xml -v -s tests; coverage xml)
test-integration:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pytest -m integration --junitxml=report.xml -v -s tests; coverage xml)
test-enduser:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pytest -m enduser --junitxml=report.xml -v -s tests; coverage xml)
benchmark:
($(CONDA_ACTIVATE) ${CONDA_ENV_NAME}; pytest -v -s -m benchmark tests || true )
all: clean install-env install