Add bytecode cleanup to postinst before building wheel

Remove stale .pyc files and __pycache__ directories before installing
the sensorpajen package to ensure Python rebuilds bytecode fresh.

This should prevent cached bytecode issues from old syntax errors.
This commit is contained in:
2025-12-28 10:42:16 +01:00
parent eee68e4034
commit a55d065c38
2 changed files with 6 additions and 0 deletions

3
debian/postinst vendored
View File

@@ -64,6 +64,9 @@ case "$1" in
# Install sensorpajen package itself
echo "Installing sensorpajen application..."
cd /opt/sensorpajen
# Clean up any stale bytecode before building wheel
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -delete
venv/bin/pip install --no-deps . || {
echo "Error: Failed to install sensorpajen package"
exit 1