@@ -272,19 +272,19 @@ def make_parser():
272
272
parser_config = subparsers .add_parser (
273
273
'config' , epilog = epilog_config ,
274
274
formatter_class = argparse .RawDescriptionHelpFormatter ,
275
- help = 'Print the configuration' )
275
+ help = 'print the configuration' )
276
276
277
277
parser_list = subparsers .add_parser (
278
278
'list' , epilog = epilog_list ,
279
279
formatter_class = argparse .RawDescriptionHelpFormatter ,
280
- help = 'Print a list of packages known to Sage' )
280
+ help = 'print a list of packages known to Sage' )
281
281
parser_list .add_argument (
282
282
'package_class' , metavar = '[PACKAGE_NAME|pkg:pypi/DISTRIBUTION-NAME|:PACKAGE_TYPE:]' ,
283
283
type = str , default = [':all-or-nothing:' ], nargs = '*' ,
284
284
help = ('package name, pkg:pypi/ followed by a distribution name, '
285
285
'or designator for all packages of a given type '
286
286
'(one of :all:, :standard:, :optional:, and :experimental:); '
287
- 'default: :all: (or nothing when --include-dependencies or --exclude-dependencies is given' ))
287
+ 'default: :all: (or nothing when --include-dependencies or --exclude-dependencies is given) ' ))
288
288
parser_list .add_argument (
289
289
'--has-file' , action = 'append' , default = [], metavar = 'FILENAME' , dest = 'has_files' ,
290
290
help = ('only include packages that have this file in their metadata directory '
@@ -306,7 +306,7 @@ def make_parser():
306
306
parser_properties = subparsers .add_parser (
307
307
'properties' , epilog = epilog_properties ,
308
308
formatter_class = argparse .RawDescriptionHelpFormatter ,
309
- help = 'Print properties of given packages' )
309
+ help = 'print properties of given packages' )
310
310
parser_properties .add_argument (
311
311
'package_class' , metavar = '[PACKAGE_NAME|pkg:pypi/DISTRIBUTION-NAME|:PACKAGE_TYPE:]' ,
312
312
type = str , nargs = '+' ,
@@ -320,7 +320,7 @@ def make_parser():
320
320
parser_dependencies = subparsers .add_parser (
321
321
'dependencies' , epilog = epilog_dependencies ,
322
322
formatter_class = argparse .RawDescriptionHelpFormatter ,
323
- help = 'Print the list of packages that are dependencies of given packages' )
323
+ help = 'print the list of packages that are dependencies of given packages' )
324
324
parser_dependencies .add_argument (
325
325
'package_class' , metavar = '[package_name|:package_type:]' ,
326
326
type = str , nargs = '+' ,
@@ -345,74 +345,88 @@ def make_parser():
345
345
parser_name = subparsers .add_parser (
346
346
'name' , epilog = epilog_name ,
347
347
formatter_class = argparse .RawDescriptionHelpFormatter ,
348
- help = 'Find the package name given a tarball filename' )
349
- parser_name .add_argument ('tarball_filename' , type = str , help = 'Tarball filename' )
348
+ help = 'find the package name given a tarball filename' )
349
+ parser_name .add_argument ('tarball_filename' , type = str , help = 'tarball filename' )
350
350
351
351
parser_tarball = subparsers .add_parser (
352
352
'tarball' , epilog = epilog_tarball ,
353
353
formatter_class = argparse .RawDescriptionHelpFormatter ,
354
- help = 'Find the tarball filename given a package name' )
355
- parser_tarball .add_argument ('package_name' , type = str , help = 'Package name' )
354
+ help = 'find the tarball filename given a package name' )
355
+ parser_tarball .add_argument ('package_name' , type = str , help = 'package name' )
356
356
357
357
parser_apropos = subparsers .add_parser (
358
358
'apropos' , epilog = epilog_apropos ,
359
359
formatter_class = argparse .RawDescriptionHelpFormatter ,
360
- help = 'Find up to 5 package names that are close to the given name' )
360
+ help = 'find up to 5 package names that are close to the given name' )
361
361
parser_apropos .add_argument (
362
362
'incorrect_name' , type = str ,
363
- help = 'Fuzzy name to search for' )
363
+ help = 'fuzzy name to search for' )
364
364
365
365
parser_update = subparsers .add_parser (
366
366
'update' , epilog = epilog_update ,
367
367
formatter_class = argparse .RawDescriptionHelpFormatter ,
368
- help = 'Update a package. This modifies the Sage sources. ' )
368
+ help = 'update a package, modifying the Sage sources' )
369
369
parser_update .add_argument (
370
- 'package_name' , type = str , help = 'Package name' )
370
+ 'package_name' , type = str , help = 'package name' )
371
371
parser_update .add_argument (
372
- 'new_version' , type = str , help = 'New version' )
372
+ 'new_version' , type = str , help = 'new version' )
373
373
parser_update .add_argument (
374
- '--url' , type = str , default = None , help = 'Download URL' )
374
+ '--url' , type = str , default = None , help = 'download URL' )
375
375
parser_update .add_argument (
376
376
'--commit' , action = "store_true" ,
377
- help = 'Whether to run "git commit"' )
377
+ help = 'whether to run "git commit"' )
378
378
379
379
parser_update_latest = subparsers .add_parser (
380
380
'update-latest' , epilog = epilog_update_latest ,
381
381
formatter_class = argparse .RawDescriptionHelpFormatter ,
382
- help = 'Update a package to the latest version. This modifies the Sage sources. ' )
382
+ help = 'update a package to the latest version, modifying the Sage sources' )
383
383
parser_update_latest .add_argument (
384
- 'package_name' , type = str , help = 'Package name (:all: for all packages)' )
384
+ 'package_name' , type = str , help = 'package name (:all: for all packages)' )
385
385
parser_update_latest .add_argument (
386
386
'--commit' , action = "store_true" ,
387
- help = 'Whether to run "git commit"' )
387
+ help = 'whether to run "git commit"' )
388
388
389
389
parser_download = subparsers .add_parser (
390
390
'download' , epilog = epilog_download ,
391
391
formatter_class = argparse .RawDescriptionHelpFormatter ,
392
- help = 'Download tarball' )
392
+ help = 'download tarball' )
393
393
parser_download .add_argument (
394
- 'package_name' , type = str , help = 'Package name or :type:' )
394
+ 'package_class' , metavar = '[package_name|:package_type:]' ,
395
+ type = str , nargs = '+' ,
396
+ help = ('package name or designator for all packages of a given type '
397
+ '(one of :all:, :standard:, :optional:, and :experimental:)' ))
398
+ parser_download .add_argument (
399
+ '--has-file' , action = 'append' , default = [], metavar = 'FILENAME' , dest = 'has_files' ,
400
+ help = ('only include packages that have this file in their metadata directory '
401
+ '(examples: SPKG.rst, spkg-configure.m4, distros/debian.txt, spkg-install|spkg-install.in)' ))
402
+ parser_download .add_argument (
403
+ '--no-file' , action = 'append' , default = [], metavar = 'FILENAME' , dest = 'no_files' ,
404
+ help = ('only include packages that do not have this file in their metadata directory '
405
+ '(examples: huge, patches, huge|has_nonfree_dependencies)' ))
406
+ parser_download .add_argument (
407
+ '--exclude' , nargs = '*' , action = 'append' , default = [], metavar = 'PACKAGE_NAME' ,
408
+ help = 'exclude package from list' )
395
409
parser_download .add_argument (
396
410
'--allow-upstream' , action = "store_true" ,
397
- help = 'Whether to fall back to downloading from the upstream URL' )
411
+ help = 'whether to fall back to downloading from the upstream URL' )
398
412
parser_download .add_argument (
399
413
'--on-error' , choices = ['stop' , 'warn' ], default = 'stop' ,
400
- help = 'What to do if the tarball cannot be downloaded' )
414
+ help = 'what to do if the tarball cannot be downloaded' )
401
415
parser_download .add_argument (
402
416
'--no-check-certificate' , action = 'store_true' ,
403
- help = 'Do not check SSL certificates for https connections' )
417
+ help = 'do not check SSL certificates for https connections' )
404
418
405
419
parser_upload = subparsers .add_parser (
406
420
'upload' , epilog = epilog_upload ,
407
421
formatter_class = argparse .RawDescriptionHelpFormatter ,
408
- help = 'Upload tarball to Sage mirrors' )
422
+ help = 'upload tarball to Sage mirrors' )
409
423
parser_upload .add_argument (
410
- 'package_name' , type = str , help = 'Package name or :type:' )
424
+ 'package_name' , type = str , help = 'package name or :type:' )
411
425
412
426
parser_fix_checksum = subparsers .add_parser (
413
427
'fix-checksum' , epilog = epilog_fix_checksum ,
414
428
formatter_class = argparse .RawDescriptionHelpFormatter ,
415
- help = 'Fix the checksum of normal packages. ' )
429
+ help = 'fix the checksum of normal packages' )
416
430
parser_fix_checksum .add_argument (
417
431
'package_class' , metavar = '[PACKAGE_NAME|pkg:pypi/DISTRIBUTION-NAME|:PACKAGE_TYPE:]' ,
418
432
type = str , default = [':all:' ], nargs = '*' ,
@@ -423,39 +437,39 @@ def make_parser():
423
437
parser_create = subparsers .add_parser (
424
438
'create' , epilog = epilog_create ,
425
439
formatter_class = argparse .RawDescriptionHelpFormatter ,
426
- help = 'Create or overwrite package. ' )
440
+ help = 'create or overwrite a package' )
427
441
parser_create .add_argument (
428
442
'package_name' , default = None , type = str ,
429
- help = 'Package name. ' )
443
+ help = 'package name' )
430
444
parser_create .add_argument (
431
- '--source' , type = str , default = None , help = 'Package source (one of normal, wheel, script, pip); default depends on provided arguments' )
445
+ '--source' , type = str , default = None , help = 'package source (one of normal, wheel, script, pip); default depends on provided arguments' )
432
446
parser_create .add_argument (
433
- '--version' , type = str , default = None , help = 'Package version' )
447
+ '--version' , type = str , default = None , help = 'package version' )
434
448
parser_create .add_argument (
435
- '--tarball' , type = str , default = None , help = 'Tarball filename pattern, e.g. Foo-VERSION.tar.bz2' )
449
+ '--tarball' , type = str , default = None , help = 'tarball filename pattern, e.g. Foo-VERSION.tar.bz2' )
436
450
parser_create .add_argument (
437
- '--type' , type = str , default = None , help = 'Package type' )
451
+ '--type' , type = str , default = None , help = 'package type' )
438
452
parser_create .add_argument (
439
- '--url' , type = str , default = None , help = 'Download URL pattern, e.g. http://example.org/Foo-VERSION.tar.bz2' )
453
+ '--url' , type = str , default = None , help = 'download URL pattern, e.g. http://example.org/Foo-VERSION.tar.bz2' )
440
454
parser_create .add_argument (
441
- '--description' , type = str , default = None , help = 'Short description of the package (for SPKG.rst)' )
455
+ '--description' , type = str , default = None , help = 'short description of the package (for SPKG.rst)' )
442
456
parser_create .add_argument (
443
- '--license' , type = str , default = None , help = 'License of the package (for SPKG.rst)' )
457
+ '--license' , type = str , default = None , help = 'license of the package (for SPKG.rst)' )
444
458
parser_create .add_argument (
445
- '--upstream-contact' , type = str , default = None , help = 'Upstream contact (for SPKG.rst)' )
459
+ '--upstream-contact' , type = str , default = None , help = 'upstream contact (for SPKG.rst)' )
446
460
parser_create .add_argument (
447
461
'--pypi' , action = "store_true" ,
448
- help = 'Create a package for a Python package available on PyPI' )
462
+ help = 'create a package for a Python package available on PyPI' )
449
463
450
464
parser_clean = subparsers .add_parser (
451
465
'clean' , epilog = epilog_clean ,
452
466
formatter_class = argparse .RawDescriptionHelpFormatter ,
453
- help = 'Remove outdated source tarballs from the upstream/ directory' )
467
+ help = 'remove outdated source tarballs from the upstream/ directory' )
454
468
455
469
parser_metrics = subparsers .add_parser (
456
470
'metrics' , epilog = epilog_metrics ,
457
471
formatter_class = argparse .RawDescriptionHelpFormatter ,
458
- help = 'Print metrics of given packages' )
472
+ help = 'print metrics of given packages' )
459
473
parser_metrics .add_argument (
460
474
'package_class' , metavar = '[PACKAGE_NAME|pkg:pypi/DISTRIBUTION-NAME|:PACKAGE_TYPE:]' ,
461
475
type = str , nargs = '*' , default = [':all:' ],
@@ -522,7 +536,9 @@ def run():
522
536
ssl ._create_default_https_context = ssl ._create_unverified_context
523
537
except ImportError :
524
538
pass
525
- app .download_cls (args .package_name ,
539
+ app .download_cls (* args .package_class ,
540
+ has_files = args .has_files , no_files = args .no_files ,
541
+ exclude = args .exclude ,
526
542
allow_upstream = args .allow_upstream ,
527
543
on_error = args .on_error )
528
544
elif args .subcommand == 'create' :
0 commit comments