forked from microsoft/CyberBattleSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createstubs.sh
executable file
·56 lines (44 loc) · 1.14 KB
/
createstubs.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
set -e
pushd "$(dirname "$0")"
echo "$(tput setaf 2)Creating type stubs$(tput sgr0)"
createstub() {
local name=$1
if [ ! -d "typings/$name" ]; then
pyright --createstub $name
else
echo stub $name already created
fi
}
param=$1
if [[ $param == "--recreate" ]]; then
echo 'Deleting typing directory'
rm -Rf typings/
fi
echo 'Creating stubs'
mkdir -p typings/
createstub pandas
createstub plotly
createstub progressbar
createstub pytest
createstub setuptools
createstub ordered_set
createstub asciichartpy
createstub networkx
createstub boolean
createstub IPython
if [ ! -d "typings/gym" ]; then
pyright --createstub gym
# Patch gym stubs
echo ' spaces = ...' >> typings/gym/spaces/dict.pyi
echo ' nvec = ...' >> typings/gym/spaces/space.pyi
echo ' spaces = ...' >> typings/gym/spaces/space.pyi
echo ' spaces = ...' >> typings/gym/spaces/tuple.pyi
echo ' n = ...' >> typings/gym/spaces/multi_binary.pyi
else
echo stub gym already created
fi
echo 'Typing stub generation completed'
popd