forked from microsoft/CyberBattleSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatestubs.sh
executable file
·54 lines (45 loc) · 1.2 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
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
set -e
. ./getpythonpath.sh
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
}
createstub networkx
createstub pandas
createstub plotly
createstub progressbar
createstub pytest
createstub setuptools
createstub ordered_set
createstub asciichartpy
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
else
echo stub gym already created
fi
if [ ! -d "typings/IPython" ]; then
pyright --createstub IPython.core.display
else
echo stub 'IPython' already created
fi
if [ ! -d "boolean" ]; then
pyright --createstub boolean
sed -i '/class BooleanAlgebra(object):/a\ TRUE = ...\n FALSE = ...' typings/boolean/boolean.pyi
else
echo stub 'boolean' already created
fi
# Stubs that needed manual patching and that
# were instead checked-in in git
# pyright --createstub boolean
# pyright --createstub gym