@@ -401,9 +401,11 @@ def run(self): # noqa: C901
401
401
if os .path .exists (rpm ):
402
402
self .move_file (rpm , self .dist_dir )
403
403
filename = os .path .join (self .dist_dir , os .path .basename (rpm ))
404
- self .distribution .dist_files .append (
405
- ('bdist_rpm' , pyversion , filename )
406
- )
404
+ self .distribution .dist_files .append ((
405
+ 'bdist_rpm' ,
406
+ pyversion ,
407
+ filename ,
408
+ ))
407
409
408
410
def _dist_path (self , path ):
409
411
return os .path .join (self .dist_dir , os .path .basename (path ))
@@ -428,9 +430,9 @@ def _make_spec_file(self): # noqa: C901
428
430
# Generate a potential replacement value for __os_install_post (whilst
429
431
# normalizing the whitespace to simplify the test for whether the
430
432
# invocation of brp-python-bytecompile passes in __python):
431
- vendor_hook = '\n ' .join (
432
- [ ' %s \\ ' % line .strip () for line in vendor_hook .splitlines ()]
433
- )
433
+ vendor_hook = '\n ' .join ([
434
+ ' %s \\ ' % line .strip () for line in vendor_hook .splitlines ()
435
+ ] )
434
436
problem = "brp-python-bytecompile \\ \n "
435
437
fixed = "brp-python-bytecompile %{__python} \\ \n "
436
438
fixed_hook = vendor_hook .replace (problem , fixed )
@@ -445,13 +447,11 @@ def _make_spec_file(self): # noqa: C901
445
447
# spec_file.append('Summary(%s): %s' % (locale,
446
448
# self.summaries[locale]))
447
449
448
- spec_file .extend (
449
- [
450
- 'Name: %{name}' ,
451
- 'Version: %{version}' ,
452
- 'Release: %{release}' ,
453
- ]
454
- )
450
+ spec_file .extend ([
451
+ 'Name: %{name}' ,
452
+ 'Version: %{version}' ,
453
+ 'Release: %{release}' ,
454
+ ])
455
455
456
456
# XXX yuck! this filename is available from the "sdist" command,
457
457
# but only after it has run: and we create the spec file before
@@ -461,14 +461,12 @@ def _make_spec_file(self): # noqa: C901
461
461
else :
462
462
spec_file .append ('Source0: %{name}-%{unmangled_version}.tar.gz' )
463
463
464
- spec_file .extend (
465
- [
466
- 'License: ' + (self .distribution .get_license () or "UNKNOWN" ),
467
- 'Group: ' + self .group ,
468
- 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot' ,
469
- 'Prefix: %{_prefix}' ,
470
- ]
471
- )
464
+ spec_file .extend ([
465
+ 'License: ' + (self .distribution .get_license () or "UNKNOWN" ),
466
+ 'Group: ' + self .group ,
467
+ 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot' ,
468
+ 'Prefix: %{_prefix}' ,
469
+ ])
472
470
473
471
if not self .force_arch :
474
472
# noarch if no extension modules
@@ -506,13 +504,11 @@ def _make_spec_file(self): # noqa: C901
506
504
if self .no_autoreq :
507
505
spec_file .append ('AutoReq: 0' )
508
506
509
- spec_file .extend (
510
- [
511
- '' ,
512
- '%description' ,
513
- self .distribution .get_long_description () or "" ,
514
- ]
515
- )
507
+ spec_file .extend ([
508
+ '' ,
509
+ '%description' ,
510
+ self .distribution .get_long_description () or "" ,
511
+ ])
516
512
517
513
# put locale descriptions into spec file
518
514
# XXX again, suppressed because config file syntax doesn't
@@ -558,37 +554,31 @@ def _make_spec_file(self): # noqa: C901
558
554
# use 'default' as contents of script
559
555
val = getattr (self , attr )
560
556
if val or default :
561
- spec_file .extend (
562
- [
563
- '' ,
564
- '%' + rpm_opt ,
565
- ]
566
- )
557
+ spec_file .extend ([
558
+ '' ,
559
+ '%' + rpm_opt ,
560
+ ])
567
561
if val :
568
562
with open (val ) as f :
569
563
spec_file .extend (f .read ().split ('\n ' ))
570
564
else :
571
565
spec_file .append (default )
572
566
573
567
# files section
574
- spec_file .extend (
575
- [
576
- '' ,
577
- '%files -f INSTALLED_FILES' ,
578
- '%defattr(-,root,root)' ,
579
- ]
580
- )
568
+ spec_file .extend ([
569
+ '' ,
570
+ '%files -f INSTALLED_FILES' ,
571
+ '%defattr(-,root,root)' ,
572
+ ])
581
573
582
574
if self .doc_files :
583
575
spec_file .append ('%doc ' + ' ' .join (self .doc_files ))
584
576
585
577
if self .changelog :
586
- spec_file .extend (
587
- [
588
- '' ,
589
- '%changelog' ,
590
- ]
591
- )
578
+ spec_file .extend ([
579
+ '' ,
580
+ '%changelog' ,
581
+ ])
592
582
spec_file .extend (self .changelog )
593
583
594
584
return spec_file
0 commit comments