2023-06-26 14:50:06 +00:00
|
|
|
# Run tests and linters
|
|
|
|
|
@default: test lint
|
|
|
|
|
|
2023-07-02 19:36:22 +00:00
|
|
|
# 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-06-26 14:50:06 +00:00
|
|
|
pipenv run cog --check README.md docs/*.md
|
2023-07-15 17:00:04 +00:00
|
|
|
echo " mypy"
|
2023-07-02 19:36:22 +00:00
|
|
|
pipenv run mypy llm
|
2023-07-15 17:00:04 +00:00
|
|
|
echo " ruff"
|
2023-07-02 19:41:40 +00:00
|
|
|
pipenv run ruff .
|
2023-06-26 14:50:06 +00:00
|
|
|
|
|
|
|
|
# Rebuild docs with cog
|
|
|
|
|
@cog:
|
|
|
|
|
pipenv run cog -r docs/*.md
|
|
|
|
|
|
|
|
|
|
# Serve live docs on localhost:8000
|
|
|
|
|
@docs: cog
|
|
|
|
|
cd docs && pipenv run make livehtml
|
|
|
|
|
|
|
|
|
|
# Apply Black
|
|
|
|
|
@black:
|
|
|
|
|
pipenv run black .
|
2023-07-03 00:40:45 +00:00
|
|
|
|
|
|
|
|
# Run automatic fixes
|
2023-07-10 14:41:49 +00:00
|
|
|
@fix: cog
|
2023-07-03 00:40:45 +00:00
|
|
|
pipenv run ruff . --fix
|
2023-07-10 14:41:49 +00:00
|
|
|
pipenv run black .
|