Attempt to handles old-style (pre PEP-517) command line passed by old releases of pip to a `setup.py` script, and manual running of `setup.py`. This is partial support at best.
(self, argv)
| 1191 | |
| 1192 | |
| 1193 | def handle_argv(self, argv): |
| 1194 | ''' |
| 1195 | Attempt to handles old-style (pre PEP-517) command line passed by |
| 1196 | old releases of pip to a `setup.py` script, and manual running of |
| 1197 | `setup.py`. |
| 1198 | |
| 1199 | This is partial support at best. |
| 1200 | ''' |
| 1201 | global g_verbose |
| 1202 | #log2(f'argv: {argv}') |
| 1203 | |
| 1204 | class ArgsRaise: |
| 1205 | pass |
| 1206 | |
| 1207 | class Args: |
| 1208 | ''' |
| 1209 | Iterates over argv items. |
| 1210 | ''' |
| 1211 | def __init__( self, argv): |
| 1212 | self.items = iter( argv) |
| 1213 | def next( self, eof=ArgsRaise): |
| 1214 | ''' |
| 1215 | Returns next arg. If no more args, we return <eof> or raise an |
| 1216 | exception if <eof> is ArgsRaise. |
| 1217 | ''' |
| 1218 | try: |
| 1219 | return next( self.items) |
| 1220 | except StopIteration: |
| 1221 | if eof is ArgsRaise: |
| 1222 | raise Exception('Not enough args') |
| 1223 | return eof |
| 1224 | |
| 1225 | command = None |
| 1226 | opt_all = None |
| 1227 | opt_dist_dir = 'dist' |
| 1228 | opt_egg_base = None |
| 1229 | opt_formats = None |
| 1230 | opt_install_headers = None |
| 1231 | opt_record = None |
| 1232 | opt_root = None |
| 1233 | |
| 1234 | args = Args(argv[1:]) |
| 1235 | |
| 1236 | while 1: |
| 1237 | arg = args.next(None) |
| 1238 | if arg is None: |
| 1239 | break |
| 1240 | |
| 1241 | elif arg in ('-h', '--help', '--help-commands'): |
| 1242 | log0(textwrap.dedent(''' |
| 1243 | Usage: |
| 1244 | [<options>...] <command> [<options>...] |
| 1245 | Commands: |
| 1246 | bdist_wheel |
| 1247 | Creates a wheel called |
| 1248 | <dist-dir>/<name>-<version>-<details>.whl, where |
| 1249 | <dist-dir> is "dist" or as specified by --dist-dir, |
| 1250 | and <details> encodes ABI and platform etc. |
no test coverage detected