builder: Allow .pyc files without .py

This is common for binary-only releases, for example as described
in:
https://lists.freedesktop.org/archives/flatpak/2017-June/000697.html
This commit is contained in:
Alexander Larsson
2017-06-13 11:17:06 +02:00
parent daf36ba2af
commit bc7ebd20e2
5 changed files with 56 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ skip_without_bwrap
skip_without_user_xattrs
skip_without_python2
echo "1..1"
echo "1..2"
setup_repo
install_repo
@@ -37,6 +37,7 @@ REPO=`pwd`/repo
cd $TEST_DATA_DIR/
cp $(dirname $0)/org.test.Python.json .
cp $(dirname $0)/org.test.Python2.json .
cp -a $(dirname $0)/empty-configure .
cp -a $(dirname $0)/testpython.py .
cp $(dirname $0)/importme.py .
@@ -51,3 +52,14 @@ flatpak-builder --run appdir org.test.Python.json testpython.py > testpython.out
assert_file_has_content testpython.out ^modified$
echo "ok handled pyc rewriting multiple times"
flatpak-builder --force-clean appdir org.test.Python2.json
assert_not_has_file appdir/files/bin/importme.py
assert_has_file appdir/files/bin/importme.pyc
flatpak-builder --run appdir org.test.Python2.json testpython.py > testpython.out
assert_file_has_content testpython.out "^first $"
echo "ok handled .pyc without .py"