File: python

package info (click to toggle)
sentencepiece 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 53,912 kB
  • sloc: cpp: 190,245; python: 1,776; xml: 231; perl: 198; sh: 58; pascal: 50; makefile: 23
file content (19 lines) | stat: -rwxr-xr-x 412 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

set -e

VERSION=$(dpkg-query --show --showformat='${Version}' sentencepiece | cut -d- -f1)
cat <<EOS > test_module.py
import sentencepiece as spm

print('VERSION={}'.format(spm.__version__))
EOS

PYVERSION=$(python3 test_module.py)
if [ "VERSION=$VERSION" = "$PYVERSION" ]; then
   echo "run python module"
else
   echo "Failed to get module version: <${PYVERSION}>"
   exit 1
fi
rm -f test_module.py