tsunami / Makefile
Gitdeeper4's picture
رفع جميع ملفات TSU-WAVE مع YAML
12834b7
# TSU-WAVE Makefile
.PHONY: help install dev test clean build docs docker run stop lint format
help:
@echo "TSU-WAVE Makefile"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " install Install production dependencies"
@echo " dev Install development dependencies"
@echo " test Run tests"
@echo " clean Clean build artifacts"
@echo " build Build Python package"
@echo " docs Build documentation"
@echo " docker Build Docker image"
@echo " run Run with Docker Compose"
@echo " stop Stop Docker Compose"
@echo " lint Run linters"
@echo " format Format code with black and isort"
install:
pip install --upgrade pip
pip install -r requirements.txt
@cd src/core && f2py -c nswe_solver.f90 -m nswe_solver || echo "Warning: Fortran compilation failed"
dev: install
pip install -r requirements-dev.txt
pre-commit install
test:
pytest tests/ -v --cov=src/
test-coverage:
pytest tests/ --cov=src/ --cov-report=html --cov-report=term
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf htmlcov/
rm -rf coverage.xml
rm -rf .coverage
rm -rf docs/_build/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
find . -type f -name "*.so" -delete
find . -type f -name "*.o" -delete
find . -type f -name "*.mod" -delete
build: clean
python -m build
@echo "Package built in dist/"
docs:
cd docs && make html
@echo "Documentation built in docs/_build/html/"
docker:
docker build -t tsu-wave:latest .
docker build -t tsu-wave:$(shell git describe --tags 2>/dev/null || echo "dev") .
docker-compose:
docker-compose up -d
docker-compose-dev:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
run: docker-compose
@echo "TSU-WAVE running at http://localhost:8080"
@echo "API at http://localhost:8000/docs"
stop:
docker-compose down
logs:
docker-compose logs -f
lint:
flake8 src/ tests/
black --check src/ tests/
isort --check-only src/ tests/
mypy src/
format:
black src/ tests/
isort src/ tests/
check: lint test
dist: clean build
@echo "Distribution ready in dist/"
pypi: dist
twine upload dist/*
benchmark:
python scripts/run_benchmarks.py
validate:
python scripts/validate_all_events.py
init-db:
python scripts/setup_database.py
load-data:
python scripts/load_becf_maps.py
python scripts/load_validation_data.py
.PHONY: help install dev test test-coverage clean build docs docker docker-compose docker-compose-dev run stop logs lint format check dist pypi benchmark validate init-db load-data