-
Notifications
You must be signed in to change notification settings - Fork 4
/
justfile
102 lines (80 loc) · 2.1 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package := "abacus"
source_command := if os_family() == "windows" { "call" } else { "source" }
#use cmd.exe instead of sh on Window
#set shell := ["cmd.exe", "/c"]
# List all commands
list:
just --list
# Run key tests
go:
just test
just mypy
just isort
just black
just ruff
# Run all tests, checks and linters
grill:
just go
just boil
just scripts
# Run examples in scripts folder (linux)
scripts:
cd scripts && bash -ex all.sh
cd scripts/textbook && bash -ex joan.bat
cd scripts/textbook && bash -ex yazici.bat
# Run all tests on documentation files
boil:
just run ./README.md
just run ./docs/index.md
just run ./docs/quick_start.md
# Run code and scripts from markdown file
run MD_FILE:
just run-py {{MD_FILE}}
just run-sh-clean {{MD_FILE}}
# Run Python code from markdown file
run-py MD_FILE:
codeblock python {{MD_FILE}} | poetry run python
# Run script from markdown file
run-sh MD_FILE:
codeblock bash {{MD_FILE}} > {{MD_FILE}}.sh
cd {{parent_directory(MD_FILE)}} && bash -e {{file_name(MD_FILE)}}.sh
# Run script from markdown file and cleanup after
run-sh-clean MD_FILE:
just run-sh {{MD_FILE}}
rm {{MD_FILE}}.sh
cd {{parent_directory(MD_FILE)}} && rm -f chart.json entries.linejson starting_balances.json
# Run pytest (up to first error) and print slowest test times
test:
poetry run pytest . -x --durations=5
# Type check
mypy:
poetry run mypy {{ package }}
# Run isort (black-compatible and float imports to top)
isort:
poetry run isort --profile black --float-to-top .
# Run black
black:
poetry run black .
# Apply ruff
ruff:
poetry run ruff check . --fix
# Prettify markdown files (use .prettierignore to exclude files)
md:
npx prettier . --write
# Build and serve docs
docs:
poetry run mkdocs serve
lazy:
poetry run lazydocs --overview-file L_README.md --src-base-url https://github.com/rustedpy/result/blob/master/ abacus
# Publish docs
docs-publish:
just md
poetry run mkdocs gh-deploy
# Publish to PyPI
publish:
poetry publish --build
patch:
poetry version patch
# Launch Streamlit app
stream:
poetry run streamlit run streamlit_app.py