-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_build.sh
More file actions
executable file
Β·58 lines (45 loc) Β· 1.46 KB
/
test_build.sh
File metadata and controls
executable file
Β·58 lines (45 loc) Β· 1.46 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
#!/bin/bash
# FCSP API Test Build Script
# This script tests the package build process without publishing
set -e # Exit on any error
echo "π§ͺ Testing FCSP API Package Build"
echo "=================================="
# Check if we're in the right directory
if [ ! -f "pyproject.toml" ] || [ ! -f "setup.py" ]; then
echo "β Error: Please run this script from the fcsp-api root directory"
exit 1
fi
# Check if required tools are installed
echo "π§ Checking build tools..."
python -c "import build" 2>/dev/null || {
echo "β Error: 'build' package not found. Install with: pip install build"
exit 1
}
python -c "import twine" 2>/dev/null || {
echo "β Error: 'twine' package not found. Install with: pip install twine"
exit 1
}
# Clean previous builds
echo "π§Ή Cleaning previous builds..."
rm -rf dist/ build/ *.egg-info/
# Build the package
echo "π¦ Building package..."
python -m build
# Check the built package
echo "π Checking built package..."
twine check dist/*
# Test installation
echo "π§ͺ Testing installation..."
pip install dist/*.whl --force-reinstall
# Test import
echo "π Testing import..."
python -c "from fcsp_api import FCSP; print('β
Import successful!')"
# Test command line tool
echo "π Testing command line tool..."
fcsp-scanner --help
echo ""
echo "β
All tests passed!"
echo "π¦ Package builds successfully"
echo "π§ Ready for publication"
echo ""
echo "π‘ To publish to PyPI, run: ./build_and_publish.sh"