-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
49 lines (39 loc) · 1.44 KB
/
build.sh
File metadata and controls
49 lines (39 loc) · 1.44 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
#!/bin/bash
set -e
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log() { echo -e "${BLUE}[INFO]${NC} $1"; }
success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARNING]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; exit 1; }
log "Cleaning previous builds..."
mkdir -p dist
log "Checking environment..."
if ! command -v jq &> /dev/null; then
warn "jq is not installed. This is required for the final package to work."
warn "Install jq before using jonq: https://stedolan.github.io/jq/download/"
fi
log "Installing build dependencies..."
pip install -U pip maturin hatchling twine wheel build
log "Building packages separately..."
log "Building Python package (jonq)..."
python -m build || error "Failed to build Python package"
log "Built packages:"
ls -lh dist/
log "Testing Python package..."
pip install --force-reinstall dist/jonq*.whl
python -c "from jonq.csv_utils import flatten_json; print('Python package test:', flatten_json({'test': 'data'}))" || error "Python package test failed"
success "Build successful!"
echo ""
echo "Packages are built as separate wheels, which is the correct approach."
echo "The packages are designed to work together but remain separate."
echo ""
echo "To upload to PyPI (separate packages):"
echo " twine upload dist/*.whl"
echo ""
echo "To install locally:"
echo " pip install dist/jonq-*.whl # Python package only"
echo ""