-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
78 lines (65 loc) · 1.67 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
pkg := "priwo"
alias l := loc
alias t := test
alias d := docs
alias c := clean
alias i := install
alias u := uninstall
# List available commands.
default:
#!/usr/bin/env python
from rich.table import Table
from rich.panel import Panel
from rich.console import Console
console = Console()
grid = Table.grid(expand=True, padding=(0, 2, 0, 2))
grid.add_column(justify="left", style="bold")
grid.add_column(justify="right", style="italic")
grid.add_row("loc ([i]l[/i])", "Chart LOCs")
grid.add_row("clean ([i]c[/i])", "Clean up")
grid.add_row("test ([i]t[/i])", "Run tests")
grid.add_row("install ([i]i[/i])", "Install")
grid.add_row("uninstall ([i]u[/i])", "Uninstall")
grid.add_row("docs ([i]d[/i])", "Build docs.")
console.print(
Panel(
grid,
padding=2,
expand=False,
title="[b]{{pkg}}[/b]: [i]I/O for common pulsar data formats.[/i]",
)
)
# Chart LOCs.
@loc:
echo "Charting LOCs..."
tokei src tests -o json | tokei-pie
# Clean up.
@clean:
echo "Cleaning..."
rm -rf tmp
rm -rf dist
rm -rf build
rm -rf .eggs
rm -rf .coverage
rm -rf .mypy_cache
rm -rf docs/build/*
rm -rf .pytest_cache
fd -I -e pyc -x rm -rf
fd -I __pycache__ -x rm -rf
# Run tests.
@test: && clean
ward
# Install.
@install: && clean
echo "Installing..."
pip install -e .
# Uninstall.
@uninstall: && clean
echo "Uninstalling {{pkg}}..."
pip uninstall {{pkg}}
rm -rf src/{{pkg}}.egg-info
rm -rf src/{{pkg}}/_version.py
# Build docs.
@docs:
echo "Building docs for {{pkg}}..."
sphinx-autobuild docs/source docs/build