File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2- # Script checking that all symbols exported by libpython start with Py or _Py
2+ """Check exported symbols
33
4+ Check that all symbols exported by CPython (libpython, stdlib extension
5+ modules, and similar) start with Py or _Py, or are covered by an exception.
6+ """
7+
8+ import argparse
49import dataclasses
510import functools
611import pathlib
@@ -136,6 +141,12 @@ def get_extension_libraries():
136141
137142
138143def main ():
144+ parser = argparse .ArgumentParser (
145+ description = __doc__ .split ('\n ' , 1 )[- 1 ])
146+ parser .add_argument ('-v' , '--verbose' , action = 'store_true' ,
147+ help = 'be verbose (currently: print out all symbols)' )
148+ args = parser .parse_args ()
149+
139150 libraries = []
140151
141152 # static library
@@ -161,9 +172,11 @@ def main():
161172 smelly_symbols = []
162173 for library in libraries :
163174 symbols = get_exported_symbols (library )
164- print (f"{ library .path } : { len (symbols )} symbol(s) found" )
175+ if args .verbose :
176+ print (f"{ library .path } : { len (symbols )} symbol(s) found" )
165177 for symbol in sorted (symbols ):
166- print (" -" , symbol .name )
178+ if args .verbose :
179+ print (" -" , symbol .name )
167180 if symbol .is_smelly :
168181 smelly_symbols .append (symbol )
169182
You can’t perform that action at this time.
0 commit comments