Print one import section with categorized libraries.
(name, libs, args)
| 112 | |
| 113 | |
| 114 | def print_section(name, libs, args): |
| 115 | """Print one import section with categorized libraries.""" |
| 116 | categorized = classify_libs(libs) |
| 117 | |
| 118 | print(f"\n{name} pulled in:") |
| 119 | for lib in categorized['shared']: |
| 120 | print(f" {strip_prefix(lib)}") |
| 121 | |
| 122 | if args.show_stdlib and categorized['stdlib']: |
| 123 | print(f"\n stdlib extensions ({len(categorized['stdlib'])}):") |
| 124 | for lib in categorized['stdlib']: |
| 125 | print(f" {strip_prefix(lib)}") |
| 126 | |
| 127 | if args.show_extensions and categorized['extensions']: |
| 128 | print(f"\n numpy/scipy extensions ({len(categorized['extensions'])}):") |
| 129 | for lib in categorized['extensions']: |
| 130 | print(f" {strip_prefix(lib)}") |
| 131 | |
| 132 | hidden = [] |
| 133 | if not args.show_stdlib and categorized['stdlib']: |
| 134 | hidden.append(f"{len(categorized['stdlib'])} stdlib") |
| 135 | if not args.show_extensions and categorized['extensions']: |
| 136 | hidden.append(f"{len(categorized['extensions'])} numpy/scipy") |
| 137 | if hidden: |
| 138 | print(f" ({' + '.join(hidden)} extension modules hidden)") |
| 139 | print() |
| 140 | |
| 141 | |
| 142 | def main(): |
no test coverage detected
searching dependent graphs…