forked from Tudat/tudatBundle
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathgenerate_stubs.sh
35 lines (28 loc) · 936 Bytes
/
generate_stubs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# allow input to set compilation config
while getopts d:j:c:t flag
do
case "${flag}" in
d) build_dir=${OPTARG};;
j) number_of_processors=${OPTARG};;
c) clean_build=${OPTARG};;
t) build_type=${OPTARG};;
esac
done
# env control arguments
BUILD_DIR="${build_dir:-build}"
RUN_TESTS="${run_tests:-1}"
BUILD_TESTS="${build_tests:-1}"
NUMBER_OF_PROCESSORS=${number_of_processors:-1}
CLEAN_BUILD=${clean_build:-0}
BUILD_TYPE=${build_type:-Release}
# construct conda environment path
export PYTHONPATH=".:$CONDA_PREFIX:$PYTHONPATH"
# move to tudatpy module inside build directory
cd $BUILD_DIR/tudatpy
# generate stubs
PYTHONPATH=".:$PYTHONPATH" stubgen -p tudatpy.kernel -o .
# move stubs out from tudatpy/kernel and into tudatpy/
rsync -avh --remove-source-files --ignore-times --exclude '/__init__.pyi' tudatpy/kernel/* .
# remove kernel stub directory
rm -r tudatpy/kernel/*