-
-
Notifications
You must be signed in to change notification settings - Fork 268
/
Justfile
50 lines (41 loc) · 1.02 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Run tests and linters
@default: test lint
# Install dependencies and test dependencies
@init:
pipenv run pip install -e '.[test]'
# Run pytest with supplied options
@test *options:
pipenv run pytest {{options}}
# Run linters
@lint:
echo "Linters..."
echo " Black"
pipenv run black . --check
echo " cog"
pipenv run cog --check \
-p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" \
README.md docs/*.md
echo " mypy"
pipenv run mypy llm
echo " ruff"
pipenv run ruff check .
# Run mypy
@mypy:
pipenv run mypy llm
# 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
# Serve live docs on localhost:8000
@docs: cog
rm -rf docs/_build
cd docs && pipenv run make livehtml
# Apply Black
@black:
pipenv run black .
# Run automatic fixes
@fix: cog
pipenv run ruff check . --fix
pipenv run black .
# Push commit if tests pass
@push: test lint
git push