forked from csalitred/semantic-segmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (39 loc) · 1.24 KB
/
Makefile
File metadata and controls
48 lines (39 loc) · 1.24 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
44
45
46
47
# Makefile for installing project dependencies
# Specify the Python version
PYTHON_VERSION := 3.10
# Name of the virtual environment
ENV_NAME := my_env
# Check if the current environment is venv or Conda
ifndef env
env := venv
endif
# Commands for venv environment
ifeq ($(env),venv)
# Use venv
CREATE_ENV_COMMAND := python$(PYTHON_VERSION) -m venv $(ENV_NAME)
ACTIVATE_ENV_COMMAND := source $(ENV_NAME)/bin/activate
DEACTIVATE_ENV_COMMAND := deactivate
# Commands for Conda environment
else
# Use Conda
CREATE_ENV_COMMAND := conda create --prefix $(ENV_NAME) python=$(PYTHON_VERSION) -y
ACTIVATE_ENV_COMMAND := conda activate $(ENV_NAME)
DEACTIVATE_ENV_COMMAND := conda deactivate
endif
# Install project dependencies
install:
$(MAKE) create_env
$(MAKE) requirements
@echo "Installation complete."
# Install dependencies from requirements.txt
requirements:
@echo "Installing dependencies from requirements.txt..."
@$(ACTIVATE_ENV_COMMAND) && pip install -r requirements.txt
# Create the virtual environment
create_env:
@echo "Creating $(env) environment..."
@$(CREATE_ENV_COMMAND)
# Delete the virtual environment
delete_env:
@echo "Deleting $(env) environment..."
@rm -rf $(ENV_NAME)