From 8e4c864feab66a790cfb4e92708754b026acb2ba Mon Sep 17 00:00:00 2001 From: Leo Meyerovich Date: Tue, 4 Apr 2023 15:14:40 -0700 Subject: [PATCH] docs(stubgen): wip for feeding GPT docs --- .gitignore | 2 ++ bin/stubgen.sh | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 bin/stubgen.sh diff --git a/.gitignore b/.gitignore index 9fb2c10c4c..2eee46bd79 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,5 @@ demos/data/BIOGRID-IDENTIFIERS-3.3.123.tab.txt # local jupyter dev jupyter_dev/ + +out/ \ No newline at end of file diff --git a/bin/stubgen.sh b/bin/stubgen.sh new file mode 100755 index 0000000000..c0d2b10cbf --- /dev/null +++ b/bin/stubgen.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +TMP_PATH=${TMP_PATH:-/tmp/graphistry-stubgen} + +rm -rf $TMP_PATH +mkdir -p $TMP_PATH + +stubgen -o $TMP_PATH -q --export-less --no-import graphistry +#find $TMP_PATH + +( +# generate combined .pyi stub file for each file in graphistry +for f in `find graphistry | grep -v graphistry/tests | grep -E '*.py$' | grep -E 'chain|hop'`; do + #stubgen -o $TMP_PATH $f + + # f2 as f except without the prefix graphistry + f2=`echo $f | sed 's/^graphistry\///'` + + echo "### $f2" + cat $TMP_PATH/${f}i \ + | grep -v -E '^import|^from|^#|^$' \ + | grep -E '(^class)|(^ )|(^def)|(^@)' + echo +done +) #| wc -c \ No newline at end of file