@@ -3145,20 +3145,32 @@ def test_make_archive(self):
31453145 ft .write_file (os .path .join (tardir , 'lib' , 'lib.so' ), 'Dummy library' )
31463146 ft .write_file (os .path .join (tardir , 'include' , 'header.h' ), 'Dummy header' )
31473147
3148+ unreprod_tar = ft .make_archive (tardir , reproducible = False )
3149+ unreprod_tar_chksum = ft .compute_checksum (unreprod_tar , checksum_type = "sha256" )
3150+ self .assertEqual (unreprod_tar , "test_archive.tar.xz" )
3151+ os .remove (unreprod_tar )
3152+ reprod_tar = ft .make_archive (tardir , reproducible = True )
3153+ reprod_tar_chksum = ft .compute_checksum (reprod_tar , checksum_type = "sha256" )
3154+ self .assertEqual (reprod_tar , "test_archive.tar.xz" )
3155+ os .remove (reprod_tar )
3156+ custom_tar = ft .make_archive (tardir , archive_name = "custom_name" , reproducible = True )
3157+ custom_tar_chksum = ft .compute_checksum (custom_tar , checksum_type = "sha256" )
3158+ self .assertEqual (custom_tar , "custom_name.tar.xz" )
3159+ os .remove (custom_tar )
3160+ customdir_tar = ft .make_archive (tardir , archive_name = "custom_name" , archive_dir = tmpdir , reproducible = True )
3161+ customdir_tar_chksum = ft .compute_checksum (customdir_tar , checksum_type = "sha256" )
3162+ self .assertEqual (customdir_tar , os .path .join (tmpdir , "custom_name.tar.xz" ))
3163+ os .remove (customdir_tar )
3164+
31483165 reference_checksum = "ec0f91a462c2743b19b428f4c177d7109d2ccc018dcdedc12570d9d735d6fb1b"
31493166
3150- test_tar = ft .make_archive (tardir , reproducible = False )
3151- self .assertEqual (test_tar , "test_archive.tar.xz" )
3152- self .assertNotEqual (ft .compute_checksum (test_tar , checksum_type = "sha256" ), reference_checksum )
3153- test_tar = ft .make_archive (tardir , reproducible = True )
3154- self .assertEqual (test_tar , "test_archive.tar.xz" )
3155- self .assertEqual (ft .compute_checksum (test_tar , checksum_type = "sha256" ), reference_checksum )
3156- test_tar = ft .make_archive (tardir , archive_name = "custom_name" , reproducible = True )
3157- self .assertEqual (test_tar , "custom_name.tar.xz" )
3158- self .assertEqual (ft .compute_checksum (test_tar , checksum_type = "sha256" ), reference_checksum )
3159- test_tar = ft .make_archive (tardir , archive_name = "custom_name" , archive_dir = tmpdir , reproducible = True )
3160- self .assertEqual (test_tar , os .path .join (tmpdir , "custom_name.tar.xz" ))
3161- self .assertEqual (ft .compute_checksum (test_tar , checksum_type = "sha256" ), reference_checksum )
3167+ if sys .version_info [0 ] >= 3 and sys .version_info [1 ] >= 9 :
3168+ # checksums of tarballs made by EB cannot be reliably checked prior to Python 3.9
3169+ # due to changes introduced in python/cpython#90021
3170+ self .assertNotEqual (unreprod_tar_chksum , reference_checksum )
3171+ self .assertEqual (reprod_tar_chksum , reference_checksum )
3172+ self .assertEqual (custom_tar_chksum , reference_checksum )
3173+ self .assertEqual (customdir_tar_chksum , reference_checksum )
31623174
31633175 def test_is_sha256_checksum (self ):
31643176 """Test for is_sha256_checksum function."""
0 commit comments