-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathjustfile
More file actions
63 lines (53 loc) · 1.63 KB
/
justfile
File metadata and controls
63 lines (53 loc) · 1.63 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
# Default recipe - show help
default:
@just --list
# Install the virtual environment and install the pre-commit hooks
install:
#!/usr/bin/env bash
echo "🚀 Creating virtual environment using uv"
uv sync
uv run prek install
# Run code quality tools
check:
#!/usr/bin/env bash
echo "🚀 Checking lock file consistency with 'pyproject.toml'"
uv lock --locked
echo "🚀 Linting code: Running prek"
uv run prek run -a
echo "🚀 Static type checking: Running mypy"
uv run mypy src
# Run vulture to check for unused code
vulture:
#!/usr/bin/env bash
echo "🚀 Checking for unused code with vulture"
uv run prek run vulture --hook-stage manual --all-files
# Test the code with pytest
test:
#!/usr/bin/env bash
echo "🚀 Testing code: Running pytest"
uv run python -m pytest --doctest-modules
# Clean build artifacts
clean-build:
#!/usr/bin/env bash
echo "🚀 Removing build artifacts"
uv run python -c "import shutil; import os; shutil.rmtree('dist') if os.path.exists('dist') else None"
# Build wheel file
build: clean-build
#!/usr/bin/env bash
echo "🚀 Creating wheel file"
uvx --from build pyproject-build --installer uv
# Publish a release to PyPI
publish:
#!/usr/bin/env bash
echo "🚀 Publishing."
uvx twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
# Build and publish
build-and-publish: build publish
# Test if documentation can be built without warnings or errors
docs-test:
#!/usr/bin/env bash
uv run mkdocs build -s
# Build and serve the documentation
docs:
#!/usr/bin/env bash
uv run mkdocs serve