-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
64 lines (51 loc) · 1.64 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
# List all available recipes
default:
just --list
# Check that all required tools are installed
[group("installation")]
check-versions:
uv --version # https://docs.astral.sh/uv/
just --version # https://github.com/casey/just
# Create virtual environment and install dependencies
[group("installation")]
create-venv:
uv sync
# Install pre-commit hooks
[group("installation")]
install-pre-commit:
uv run pre-commit install
# Run all project setup steps (assumes uv and just are installed)
[group("installation")]
setup: create-venv install-pre-commit
# Run pre-commit hooks
[group("linting, formatting & testing")]
pre-commit:
uv run pre-commit run --all
# Run tests
[group("linting, formatting & testing")]
test:
uv run pytest
# Run tests with coverage report
[group("linting, formatting & testing")]
test-cov:
uv run pytest --cov=src --cov-report=html
# Create a new version tag (will trigger publish.yaml workflow)
[group("packaging")]
publish:
#!/usr/bin/env bash
# Get last tag from git
CURRENT_VERSION=$(git describe --tags --abbrev=0)
echo "Current version: $CURRENT_VERSION"
# Remove 'v' prefix if it exists
VERSION_NUMBER=$(echo $CURRENT_VERSION | sed 's/^v//')
# Split version into major.minor.patch
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION_NUMBER"
# Increment patch version
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
# Create git tag (always with 'v' prefix)
NEW_TAG="v$NEW_VERSION"
echo "New version: $NEW_TAG"
# Create and push the new tag
git tag -a "$NEW_TAG" -m "Release version $NEW_VERSION"
git push origin "$NEW_TAG"