-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
51 lines (44 loc) · 1.29 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
MAKEFLAGS += --warn-undefined-variables
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := all
# Root directory - directory of the Makefile
root_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
# Directory of the methylprep package
package_dir := $(cur_dir)methylprep
# Directory for the docs
docs_dir := $(cur_dir)docs
# Path to the conda environment file
conda_env_path := $(root_dir)conda-env.yml
# Path to the requirements file
requirements_path := $(root_dir)requirements.txt
# Local vars
venv_name := methylprep
.PHONY: all
all: init activate #help: inits and activates the environment
.PHONY: init
init: #help: Creates the virtual environment
@echo 'Creating conda environment:'
@echo '$(venv_name)'
@echo ''
@echo 'Command:'
conda env create --file $(conda_env_path)
.PHONY: update
update: #help: Updates the virtual environment
@echo 'Updating conda environment:'
@echo '$(venv_name)'
@echo ''
@echo 'Command:'
conda env update --file $(conda_env_path)
.PHONY: test
.SILENT: test
test: #help: Runs the unit test suite
( \
source activate $(venv_name); \
python setup.py test; \
)
clean: #help: Cleans python cache files
@echo 'Cleaning python cache files'
( \
find . -name '*.pyc' -type f -exec rm -rf {} + ; \
find . -name '__pycache__' -type d -exec rm -rf {} + ; \
)