Skip to content

Commit

Permalink
loadtest related
Browse files Browse the repository at this point in the history
  • Loading branch information
zihanxiao23 committed Dec 9, 2024
1 parent b1bf9c5 commit b521351
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Define variables
PYTHON = python3
PIP = pip3
REQUIREMENTS = requirements.txt

# Default target
.PHONY: help
help:
@echo "Available commands:"
@echo " make install Install all dependencies from requirements.txt"
@echo " make run Run the FastAPI application"
@echo " make clean Clean up unnecessary files"
@echo " make test Run tests (if applicable)"
@echo " make check-env Check Python and pip version"
@echo " make freeze Update requirements.txt"

# Install dependencies
.PHONY: install
install:
@echo "Installing dependencies..."
$(PIP) install -r $(REQUIREMENTS)

# Run the FastAPI application
.PHONY: run
run:
@echo "Running FastAPI application..."
$(PYTHON) -m uvicorn src.app:app --host 0.0.0.0 --port 5000 --reload

# Clean up unnecessary files
.PHONY: clean
clean:
@echo "Cleaning up unnecessary files..."
rm -rf __pycache__ .pytest_cache .mypy_cache *.pyc *.pyo

# Run tests
.PHONY: test
test:
@echo "Running tests..."
$(PYTHON) -m pytest

# Check Python and pip version
.PHONY: check-env
check-env:
@echo "Checking Python and pip versions..."
$(PYTHON) --version
$(PIP) --version

# Freeze installed dependencies into requirements.txt
.PHONY: freeze
freeze:
@echo "Freezing installed dependencies into requirements.txt..."
$(PIP) freeze > $(REQUIREMENTS)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ fastapi==0.100.0
pydantic==1.10.2
uvicorn==0.22.0
gunicorn==20.1.0
pyspark==3.3.2
pyspark==3.3.2

0 comments on commit b521351

Please sign in to comment.