-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
70 lines (53 loc) · 1.25 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
set windows-shell := ["C:\\Program Files\\Git\\bin\\sh.exe", "-c"]
_default: tasks
# List tasks
tasks:
@just --list --unsorted
_setup_poetry:
@poetry install
# SetUp project
setup: _setup_poetry
(just mypy 2> /dev/null ; yes | poetry run mypy --install-types)
@poetry run pre-commit install
# Run ipython
ipython:
@poetry run ipython
# Run 'ruff'
ruff *args:
@poetry run ruff {{ args }} .
# Run organize imports and format all code
format:
@just ruff check --select I --fix
@just ruff format
# Run mypy
mypy *args:
@poetry run mypy {{ args }} .
# Lint code
lint: format
@just ruff check
@just mypy
# 'ruff --fix'
ruff-fix:
@just ruff --fix
# Format and Lint code, and validate poetry
check: format lint
@poetry check
# Run
run *args:
@poetry run pyproject-cli {{ args }}
# Update the Usage img in README.md
_update_readme:
COLUMNS=$(COLUMNS=$(tput cols) just run --help | head -n 1 | wc -c) just run --make-help-preview
# Build project
build: _setup_poetry
@just _update_readme
@poetry build
# Install program using pipx
install: build
@py -m pipx install ./dist/`ls -t dist | head -n2 | grep whl`
# Uninstall program using pipx
uninstall:
@py -m pipx uninstall pyproject-cli
# Reinstall program using pipx
reinstall: uninstall
@just install