mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06: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
1 changed files with 13 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue