-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprocess.py
36 lines (27 loc) · 1.01 KB
/
process.py
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
__doc__ = f"""
process - simple test driver for docs2stubs for analyzing, stubbing, and augmenting modules
from within VS Code.
Usage:
process (analyze|stub|augment|all) <package>
process -h | --help
process --version
Options:
<package> The target package (e.g. matplotlib or sklearn).
The package/module needs to be installed in the environment from which
you are running this script.
"""
__version__ = '0.1'
from docopt import docopt
from docs2stubs.analyzing_transformer import analyze_module
from docs2stubs.stubbing_transformer import stub_module
from docs2stubs.traces import init_trace_loader
def main():
arguments = docopt(__doc__, version=__version__) # type: ignore
package = arguments['<package>']
init_trace_loader('tracing', package)
if arguments['analyze'] or arguments['all']:
analyze_module(package, output_trivial_types=False)
if arguments['stub'] or arguments['all']:
stub_module(package, skip_analysis=True)
if __name__ == '__main__':
main()