Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile #80

Merged
merged 6 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build/

# Virtual environments
.env
.env.sh
venv/
ENV/

Expand Down
53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
SHELL := /bin/bash

# Color codes
COLOR_RESET=\033[0m
COLOR_CYAN=\033[1;36m
COLOR_GREEN=\033[1;32m

.PHONY: help install dev-install run

.DEFAULT_GOAL := help

.SILENT:

name := $(word 2,$(MAKECMDGOALS))

help:
@echo "Please use 'make <target>' where <target> is one of the following:"
@echo " help Return this message with usage instructions."
@echo " install Will install the dependencies and create a virtual environment."
@echo " dev-install Will install the dev dependencies too."
@echo " run <folder_name> Runs GPT Engineer on the folder with the given name."

dev-install: create-venv upgrade-pip install-dependencies install-pre-commit farewell

install: create-venv upgrade-pip install-dependencies farewell

create-venv:
@echo -e "$(COLOR_CYAN)Creating virtual environment...$(COLOR_RESET)" && \
python -m venv venv

upgrade-pip:
@echo -e "$(COLOR_CYAN)Upgrading pip...$(COLOR_RESET)" && \
source venv/bin/activate && \
pip install --upgrade pip >> /dev/null

install-dependencies:
@echo -e "$(COLOR_CYAN)Installing dependencies...$(COLOR_RESET)" && \
source venv/bin/activate && \
pip install -r requirements.txt >> /dev/null

install-pre-commit:
@echo -e "$(COLOR_CYAN)Installing pre-commit hooks...$(COLOR_RESET)" && \
source venv/bin/activate && \
pre-commit install

farewell:
@echo -e "$(COLOR_GREEN)All done!$(COLOR_RESET)"

run:
@echo -e "$(COLOR_CYAN)Running GPT Engineer on $(COLOR_GREEN)$(name)$(COLOR_CYAN) folder...$(COLOR_RESET)" && \
source venv/bin/activate && \
python -m gpt_engineer.main $(name)