llm/Justfile

51 lines
1 KiB
Makefile
Raw Permalink Normal View History

2023-06-26 14:50:06 +00:00
# Run tests and linters
@default: test lint
# Install dependencies and test dependencies
@init:
pipenv run pip install -e '.[test]'
2023-06-26 14:50:06 +00:00
# Run pytest with supplied options
@test *options:
pipenv run pytest {{options}}
# Run linters
@lint:
2023-07-15 17:00:04 +00:00
echo "Linters..."
echo " Black"
2023-06-26 14:50:06 +00:00
pipenv run black . --check
2023-07-15 17:00:04 +00:00
echo " cog"
2023-08-12 06:19:56 +00:00
pipenv run cog --check \
-p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" \
README.md docs/*.md
2023-07-15 17:00:04 +00:00
echo " mypy"
pipenv run mypy llm
2023-07-15 17:00:04 +00:00
echo " ruff"
2024-07-18 19:06:41 +00:00
pipenv run ruff check .
2023-06-26 14:50:06 +00:00
2023-09-09 19:19:59 +00:00
# Run mypy
@mypy:
pipenv run mypy llm
2023-06-26 14:50:06 +00:00
# Rebuild docs with cog
@cog:
pipenv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/**/*.md docs/*.md README.md
2023-06-26 14:50:06 +00:00
# Serve live docs on localhost:8000
@docs: cog
rm -rf docs/_build
2023-06-26 14:50:06 +00:00
cd docs && pipenv run make livehtml
# Apply Black
@black:
pipenv run black .
2023-07-03 00:40:45 +00:00
# Run automatic fixes
@fix: cog
2024-07-18 19:06:41 +00:00
pipenv run ruff check . --fix
pipenv run black .
# Push commit if tests pass
@push: test lint
git push