-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1bf9c5
commit b521351
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |