Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. .PHONY: sync
  2. sync:
  3. uv sync --all-extras --dev
  4. .PHONY: test-env
  5. test-env: sync
  6. uv run python -c "import litellm"
  7. uv run python -c "from agents.extensions.models.litellm_model import LitellmModel"
  8. .PHONY: prime
  9. prime:
  10. @echo "[prime] Context priming: building structure and reviewing diffs"
  11. @echo "Full file list:"
  12. @find src/ -name "*.py" | sort
  13. @echo "--------------------------------"
  14. @echo "Top 5 largest files:"
  15. @find src/ -name "*.py" | xargs wc -l | sort -nr | head -n 5
  16. @echo "--------------------------------"
  17. @echo "Full test list:"
  18. @find tests/ -name "*.py" | sort
  19. @echo "--------------------------------"
  20. @echo "Git status:"
  21. @git status --porcelain
  22. @echo "--------------------------------"
  23. @echo "Git diff (staged):" # Only show staged changes
  24. @git diff --cached -- . ':(exclude)uv.lock' | cat
  25. @echo "--------------------------------"
  26. @echo "Git diff (unstaged):"
  27. @git diff -- . ':(exclude)uv.lock' | cat
  28. @echo "--------------------------------"
  29. .PHONY: format
  30. format:
  31. uv run ruff format --exclude docs
  32. uv run ruff check --fix --exclude docs
  33. .PHONY: lint
  34. lint:
  35. uv run ruff check --exclude docs
  36. .PHONY: lint-unsafe
  37. lint-unsafe:
  38. uv run ruff check --fix --unsafe-fixes --exclude docs
  39. .PHONY: mypy
  40. mypy:
  41. uv run mypy src
  42. .PHONY: tests
  43. tests: test-env
  44. uv run pytest
  45. .PHONY: tests-fast
  46. tests-fast: test-env
  47. uv run pytest -x --ff
  48. .PHONY: tests-verbose
  49. tests-verbose: test-env
  50. uv run pytest -v
  51. .PHONY: coverage
  52. coverage: test-env
  53. uv run coverage run -m pytest
  54. uv run coverage xml -o coverage.xml
  55. uv run coverage report -m --fail-under=90
  56. .PHONY: coverage-html
  57. coverage-html: test-env
  58. uv run coverage run -m pytest
  59. uv run coverage html
  60. @echo "Coverage report generated in htmlcov/index.html"
  61. .PHONY: clean
  62. clean:
  63. rm -rf .coverage coverage.xml htmlcov/ .pytest_cache/ .mypy_cache/ .ruff_cache/
  64. find . -type d -name __pycache__ -exec rm -rf {} +
  65. find . -type f -name "*.pyc" -delete
  66. .PHONY: check
  67. check: lint mypy
  68. .PHONY: ci
  69. ci: sync check coverage
  70. .PHONY: serve-docs
  71. serve-docs:
  72. cd docs && mintlify dev
  73. .PHONY: build
  74. build:
  75. @echo "Building package (pricing data will be auto-downloaded by build hook)..."
  76. uv build
  77. .PHONY: help
  78. help:
  79. @echo "Available commands:"
  80. @echo " sync - Install dependencies (all extras + dev)"
  81. @echo " test-env - Sync deps and verify LiteLLM test imports"
  82. @echo " format - Format code and apply safe fixes"
  83. @echo " lint - Run linting checks"
  84. @echo " lint-unsafe - Run linting with unsafe fixes"
  85. @echo " mypy - Run type checking"
  86. @echo " tests - Sync/verify test env and run all tests"
  87. @echo " tests-fast - Sync/verify test env and run tests with fail-fast and last-failed"
  88. @echo " tests-verbose- Sync/verify test env and run tests with verbose output"
  89. @echo " coverage - Sync/verify test env and run tests with coverage reporting"
  90. @echo " coverage-html- Sync/verify test env and generate HTML coverage report"
  91. @echo " clean - Clean cache files and artifacts"
  92. @echo " check - Run lint and mypy"
  93. @echo " ci - Run full CI pipeline (sync, check, coverage)"
  94. @echo " serve-docs - Serve documentation locally"
  95. @echo " build - Build the package"
  96. @echo " help - Show this help message"