-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (43 loc) · 1.36 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
# Makefile for managing the AWS Python Project
# Variables
VENV_DIR := venv
ACTIVATE := source $(VENV_DIR)/bin/activate
SHELL := /bin/bash
DEACTIVATE := deactivate
# Help command to display available commands
.PHONY: help
help:
@echo "Available commands:"
@echo " venv - Create a virtual environment"
@echo " requirements - Install dependencies"
# @echo " deploy - Deploy using AWS CloudFormation"
@echo " clean - Clean the environment"
@echo " setup - Full setup"
# Creating a local python copy
.PHONY: local
local:
pyenv local 3.11.1
pip install --upgrade pip
# Create a virtual environment
.PHONY: venv
venv:
python -m venv $(VENV_DIR)
# Activate the virtual environment (useful for running commands interactively)
.PHONY: activate
activate:
@echo "Run 'source $(VENV_DIR)/bin/activate' to activate the virtual environment."
.PHONY: deactivate
deactivate:
@echo "Run 'source deactivate' to activate the virtual environment."
# Install dependencies
.PHONY: requirements
requirements: venv
$(ACTIVATE) && pip install -r requirements.txt
# Add similar lines for other lambdas or libraries as needed
# Clean the environment (removing virtual environment)
.PHONY: clean
clean: deactivate
rm -rf $(VENV_DIR)
# Full setup: create venv, install requirements, install libs, install layers
.PHONY: setup
setup: local venv requirements