mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 15:39:14 +08:00
Add invalid imports checker
Since plugins.* is not available on the PATH for some builds, they should not be used. Relative imports are preferred
This commit is contained in:
parent
8bf7666493
commit
66105e8a3a
@ -13,6 +13,19 @@ export PKG_CONFIG_PATH="${CURA_BUILD_ENV_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}"
|
||||
|
||||
cd "${PROJECT_DIR}"
|
||||
|
||||
# Check for plugins.* import statements. These imports may work when running from source,
|
||||
# but will fail in some build types (linux and mac)
|
||||
GREP_OUTPUT=$(grep -Ern "^\s*(from plugins|import plugins)" --include \*.py "${PROJECT_DIR}" || true)
|
||||
echo "$GREP_OUTPUT"
|
||||
|
||||
if [ -z "$GREP_OUTPUT" ]
|
||||
then
|
||||
echo "invalid imports checker: OK"
|
||||
else
|
||||
echo "error: sources contain invalid imports. Use relative imports when referencing plugin source files"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Clone Uranium and set PYTHONPATH first
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user