@@ -526,58 +526,6 @@ def run_install_headers(self):
526
526
['ref' ,
527
527
['*.txt' ]]]]]])
528
528
529
-
530
- # generate the version module
531
- def parse_version (ver ):
532
- return ', ' .join (s for s in re .findall (r'\d+' , ver )[0 :3 ])
533
-
534
-
535
- def parse_source_version ():
536
- pgh_major = - 1
537
- pgh_minor = - 1
538
- pgh_patch = - 1
539
- major_exp_search = re .compile (r'define\s+PG_MAJOR_VERSION\s+([0-9]+)' ).search
540
- minor_exp_search = re .compile (r'define\s+PG_MINOR_VERSION\s+([0-9]+)' ).search
541
- patch_exp_search = re .compile (r'define\s+PG_PATCH_VERSION\s+([0-9]+)' ).search
542
- pg_header = os .path .join ('src_c' , 'include' , '_pygame.h' )
543
- with open (pg_header ) as f :
544
- for line in f :
545
- if pgh_major == - 1 :
546
- m = major_exp_search (line )
547
- if m : pgh_major = int (m .group (1 ))
548
- if pgh_minor == - 1 :
549
- m = minor_exp_search (line )
550
- if m : pgh_minor = int (m .group (1 ))
551
- if pgh_patch == - 1 :
552
- m = patch_exp_search (line )
553
- if m : pgh_patch = int (m .group (1 ))
554
- if pgh_major == - 1 :
555
- raise SystemExit ("_pygame.h: cannot find PG_MAJOR_VERSION" )
556
- if pgh_minor == - 1 :
557
- raise SystemExit ("_pygame.h: cannot find PG_MINOR_VERSION" )
558
- if pgh_patch == - 1 :
559
- raise SystemExit ("_pygame.h: cannot find PG_PATCH_VERSION" )
560
- return (pgh_major , pgh_minor , pgh_patch )
561
-
562
-
563
- def write_version_module (pygame_version , revision ):
564
- vernum = parse_version (pygame_version )
565
- src_vernum = parse_source_version ()
566
- if vernum != ', ' .join (str (e ) for e in src_vernum ):
567
- raise SystemExit ("_pygame.h version differs from 'METADATA' version"
568
- ": %s vs %s" % (vernum , src_vernum ))
569
- with open (os .path .join ('buildconfig' , 'version.py.in' )) as header_file :
570
- header = header_file .read ()
571
- with open (os .path .join ('src_py' , 'version.py' ), 'w' ) as version_file :
572
- version_file .write (header )
573
- version_file .write ('ver = "' + pygame_version + '" # pylint: disable=invalid-name\n ' )
574
- version_file .write (f'vernum = PygameVersion({ vernum } )\n ' )
575
- version_file .write ('rev = "' + revision + '" # pylint: disable=invalid-name\n ' )
576
- version_file .write ('\n __all__ = ["SDL", "ver", "vernum", "rev"]\n ' )
577
-
578
-
579
- write_version_module (METADATA ['version' ], revision )
580
-
581
529
# required. This will be filled if doing a Windows build.
582
530
cmdclass = {}
583
531
0 commit comments