-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathjustfile
More file actions
112 lines (90 loc) · 2.82 KB
/
justfile
File metadata and controls
112 lines (90 loc) · 2.82 KB
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
103
104
105
106
107
108
109
110
111
112
# Define a variable with the python command to open a browser.
BROWSER := "uv run python -c 'import webbrowser, sys; webbrowser.open(sys.argv[1])'"
VERSION := `awk -F'"' '/^version/ {print $2}' pyproject.toml`
# Show all available recipes
[default]
help:
@just --list --unsorted --list-prefix '📜 '
# remove all build, test, coverage and Python artifacts
clean: clean-build clean-pyc clean-test
# remove build artifacts
[private]
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
# remove Python file artifacts
[private]
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
# remove test and coverage artifacts
[private]
clean-test:
rm -f .coverage
rm -fr htmlcov/
# check style with ruff
lint flags="":
uv run --no-default-groups --group test ruff check {{ flags }} parglare/ tests/func examples/
# run tests quickly with the default Python
test flags="":
uv run --no-default-groups --group test --group dbg pytest {{ flags }} tests/func
# run tests for the given path
[no-cd]
testpath path="." *flags="":
uv run --no-default-groups --group test --group dbg pytest {{ flags }} {{ path }}
# Run static type checks
types:
uv run --no-default-groups --group test mypy parglare
# check code coverage quickly with the default Python
coverage:
uv run --no-default-groups --group test coverage run --omit parglare/cli.py --source parglare -m pytest tests/func
uv run --no-default-groups --group test coverage report --fail-under 90
uv run --no-default-groups --group test coverage html
{{BROWSER}} "htmlcov/index.html"
# Run all checks
check: check-format lint types coverage
# Format code with ruff
[no-cd]
format *paths=".":
uv run ruff format {{ paths }}
[private]
check-format:
uv run ruff format --check
# generate MkDocs HTML documentation
docs:
uv run --group docs mkdocs build
{{BROWSER}} site/index.html
# compile the docs watching for changes
servedocs:
{{BROWSER}} "http://localhost:8000/"
uv run --group docs mkdocs serve
# Publish latest docs
publish-docs-latest:
uv run mike deploy latest -p
# Publish stable docs for major/minor versions
publish-docs-stable: publish-docs-latest
uv run mike delete stable
uv run mike deploy {{VERSION}} stable -p
# release package to PyPI test server
release-test: dist
uv run flit publish --repository test
# release package to PyPI
release: dist
uv run flit publish
# builds source and wheel package
dist: clean
uv run flit build
gpg --armor --detach-sign dist/*.whl
gpg --armor --detach-sign dist/*.tar.gz
ls -l dist
# install the package to the active Python's site-packages
install: clean
uv pip install .
# Setup development environment
dev: clean
uv sync