File size: 1,431 Bytes
9cd8f4a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8e7168
9cd8f4a
 
 
 
 
 
 
eeb74de
9cd8f4a
 
eeb74de
 
 
 
c8e7168
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
#################################################################################
# GLOBALS                                                                       #
#################################################################################

PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_NAME = savta_depth
PYTHON_INTERPRETER = python3

ifeq (,$(shell which conda))
HAS_CONDA=False
else
HAS_CONDA=True
endif

#################################################################################
# COMMANDS                                                                      #
#################################################################################

env:
ifeq (True,$(HAS_CONDA))
	@echo ">>> Detected conda, creating conda environment."
	conda create -y --name $(PROJECT_NAME) python=3.7.6 
	@echo ">>> New conda env created. Activate with:\nconda activate $(PROJECT_NAME)"
else
	@echo ">>> No conda detected, creating venv environment."
	$(PYTHON_INTERPRETER) -m venv env
	@echo ">>> New virtual env created. Activate with:\nsource env/bin/activate ."
endif

load_requirements:
	@echo ">>> Installing requirements. Make sure your virtual environment is activated."
	$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
	$(PYTHON_INTERPRETER) -m pip install -r requirements.txt

save_requirements:
	@echo ">>> Saving requirements."
	pip list --format=freeze > requirements.txt