2019-12-16 00:59:18 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Anki bundles sip 5 generated typings that allow type checking Qt code when
|
|
|
|
# installed next to the original modules. Attempting to use them as a separate
|
|
|
|
# stubs distribution with MYPYPATH yielded a bunch of errors which I was not
|
|
|
|
# able to resolve. A solution that doesn't require modifying the python install
|
|
|
|
# would be welcome!
|
|
|
|
|
2020-03-16 19:54:59 +01:00
|
|
|
set -eo pipefail
|
|
|
|
|
2019-12-16 00:59:18 +01:00
|
|
|
TOOLS="$(cd "`dirname "$0"`"; pwd)"
|
2020-03-16 19:54:59 +01:00
|
|
|
modDir=$(python -c 'import PyQt5, sys, os; sys.stdout.write(os.path.dirname(sys.modules["PyQt5"].__file__))')
|
|
|
|
|
|
|
|
unameOut="$(uname -s)"
|
|
|
|
case "${unameOut}" in
|
|
|
|
CYGWIN*)
|
|
|
|
modDir="$(cygpath -u "${modDir}")"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-03-23 22:54:24 +01:00
|
|
|
if [[ "w${OS}" == "wWindows_NT" ]];
|
2020-03-16 19:54:59 +01:00
|
|
|
then
|
2020-03-23 22:54:24 +01:00
|
|
|
rsync -a "${TOOLS}/stubs/PyQt5/" "${modDir}/"
|
2020-03-16 19:54:59 +01:00
|
|
|
else
|
2020-03-23 22:54:24 +01:00
|
|
|
rsync -a "${TOOLS}/stubs/PyQt5/" "${modDir}/" || sudo rsync -a "${TOOLS}/stubs/PyQt5/" "${modDir}/"
|
2020-03-16 19:54:59 +01:00
|
|
|
fi
|