File: generate-python-stubs.sh

package info (click to toggle)
mrpt 1%3A2.15.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 92,456 kB
  • sloc: cpp: 555,366; ansic: 36,840; xml: 3,872; python: 2,195; sh: 524; makefile: 232
file content (19 lines) | stat: -rwxr-xr-x 644 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# Usage: ./generate-python-stubs.sh 
# To be run *after* building pymrpt.


# Generate stub .pyi files:
echo "Generating stub pyi files..."
export PYTHONPATH=$(realpath $(pwd)/../build-Release/)
if compgen -G "$PYTHONPATH/mrpt/pymrpt*.so" > /dev/null; then
    echo "Using mrpt module found under: $PYTHONPATH"
else
    echo "$PYTHONPATH does not seem to contain a compiled pymrpt module!"
    exit 1
fi
stubgen -p mrpt -p mrpt.pymrpt -o stubs-out

# applying manual patches to stubs:
echo "Applying manual patches to stubs..."
find . -name "patch-stubs*.diff" | xargs -I FIL bash -c "echo FIL && git apply FIL --ignore-whitespace"