comparison contrib/automation/hgautomation/aws.py @ 48845:5c8148cd7f13

automation: drop support for Python 2.7 in Linux environment We stop installing Python 2.7 via pyenv. We stop installing the system Python 2 packages. We delete support for running tests on Python 2.7. Differential Revision: https://phab.mercurial-scm.org/D12262
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Feb 2022 18:18:35 -0700
parents 2d6940811067
children f1dcddb7f328
comparison
equal deleted inserted replaced
48844:d79f0ce95c47 48845:5c8148cd7f13
917 'MaxCount': 1, 917 'MaxCount': 1,
918 'MinCount': 1, 918 'MinCount': 1,
919 'SecurityGroupIds': [c.security_groups['linux-dev-1'].id], 919 'SecurityGroupIds': [c.security_groups['linux-dev-1'].id],
920 } 920 }
921 921
922 requirements2_path = (
923 pathlib.Path(__file__).parent.parent / 'linux-requirements-py2.txt'
924 )
925 requirements3_path = ( 922 requirements3_path = (
926 pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.txt' 923 pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.txt'
927 ) 924 )
928 requirements35_path = ( 925 requirements35_path = (
929 pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.5.txt' 926 pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.5.txt'
930 ) 927 )
931 with requirements2_path.open('r', encoding='utf-8') as fh:
932 requirements2 = fh.read()
933 with requirements3_path.open('r', encoding='utf-8') as fh: 928 with requirements3_path.open('r', encoding='utf-8') as fh:
934 requirements3 = fh.read() 929 requirements3 = fh.read()
935 with requirements35_path.open('r', encoding='utf-8') as fh: 930 with requirements35_path.open('r', encoding='utf-8') as fh:
936 requirements35 = fh.read() 931 requirements35 = fh.read()
937 932
939 # be regenerated. 934 # be regenerated.
940 fingerprint = resolve_fingerprint( 935 fingerprint = resolve_fingerprint(
941 { 936 {
942 'instance_config': config, 937 'instance_config': config,
943 'bootstrap_script': BOOTSTRAP_DEBIAN, 938 'bootstrap_script': BOOTSTRAP_DEBIAN,
944 'requirements_py2': requirements2,
945 'requirements_py3': requirements3, 939 'requirements_py3': requirements3,
946 'requirements_py35': requirements35, 940 'requirements_py35': requirements35,
947 } 941 }
948 ) 942 )
949 943
973 sftp = client.open_sftp() 967 sftp = client.open_sftp()
974 968
975 print('uploading bootstrap files') 969 print('uploading bootstrap files')
976 with sftp.open('%s/bootstrap' % home, 'wb') as fh: 970 with sftp.open('%s/bootstrap' % home, 'wb') as fh:
977 fh.write(BOOTSTRAP_DEBIAN) 971 fh.write(BOOTSTRAP_DEBIAN)
978 fh.chmod(0o0700)
979
980 with sftp.open('%s/requirements-py2.txt' % home, 'wb') as fh:
981 fh.write(requirements2)
982 fh.chmod(0o0700) 972 fh.chmod(0o0700)
983 973
984 with sftp.open('%s/requirements-py3.txt' % home, 'wb') as fh: 974 with sftp.open('%s/requirements-py3.txt' % home, 'wb') as fh:
985 fh.write(requirements3) 975 fh.write(requirements3)
986 fh.chmod(0o0700) 976 fh.chmod(0o0700)