Spaces:
Running
Running
# Makefile for Rice Anomaly Detection UI Project | |
# Variables | |
VENV_DIR = venv | |
PYTHON = python3 | |
PIP = $(VENV_DIR)/bin/pip | |
APP = app.py # Replace with the name of your main script file | |
# Default target | |
all: setup install run | |
# Create virtual environment | |
setup: | |
@echo "Creating virtual environment..." | |
$(PYTHON) -m venv $(VENV_DIR) | |
@echo "Virtual environment created." | |
# Install dependencies | |
install: setup | |
@echo "Installing dependencies..." | |
$(PIP) install --upgrade pip | |
$(PIP) install -r requirements.txt | |
@echo "Dependencies installed." | |
# Run the Gradio app | |
run: | |
@echo "Running the Gradio app..." | |
$(VENV_DIR)/bin/python $(APP) | |
# Clean up virtual environment and generated files | |
clean: | |
@echo "Cleaning up..." | |
rm -rf $(VENV_DIR) | |
find . -type f -name "*.pyc" -delete | |
find . -type d -name "__pycache__" -delete | |
@echo "Cleaned up." | |
# Rebuild everything from scratch | |
rebuild: clean all | |
# Help message | |
help: | |
@echo "Makefile for Rice Anomaly Detection UI Project" | |
@echo "" | |
@echo "Targets:" | |
@echo " all : Set up environment, install dependencies, and run the app (default)" | |
@echo " setup : Create a virtual environment" | |
@echo " install : Install dependencies from requirements.txt" | |
@echo " run : Run the Gradio app" | |
@echo " clean : Remove virtual environment and generated files" | |
@echo " rebuild : Clean and rebuild everything" | |
@echo " help : Show this help message" |