diff contrib/automation/hgautomation/aws.py @ 47206:546e812a1c2d

automation: create Python 3.5 variant of requirements.txt The automation environment is refusing to build with the previous file because some dependencies won't install on Python 3.5. I couldn't find an easy way to salvage the situation with a single requirements.txt file. So, I decided to introduce a variant for Python 3.5. As part of this, we update packages to latest versions. (I do question why we are still supporting Python 3.5...) Differential Revision: https://phab.mercurial-scm.org/D10690
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 06 May 2021 17:46:57 -0700
parents 89a2afe31e82
children ae28d37f5969
line wrap: on
line diff
--- a/contrib/automation/hgautomation/aws.py	Sat May 15 09:45:10 2021 +0000
+++ b/contrib/automation/hgautomation/aws.py	Thu May 06 17:46:57 2021 -0700
@@ -925,10 +925,15 @@
     requirements3_path = (
         pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.txt'
     )
+    requirements35_path = (
+        pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.5.txt'
+    )
     with requirements2_path.open('r', encoding='utf-8') as fh:
         requirements2 = fh.read()
     with requirements3_path.open('r', encoding='utf-8') as fh:
         requirements3 = fh.read()
+    with requirements35_path.open('r', encoding='utf-8') as fh:
+        requirements35 = fh.read()
 
     # Compute a deterministic fingerprint to determine whether image needs to
     # be regenerated.
@@ -938,6 +943,7 @@
             'bootstrap_script': BOOTSTRAP_DEBIAN,
             'requirements_py2': requirements2,
             'requirements_py3': requirements3,
+            'requirements_py35': requirements35,
         }
     )
 
@@ -979,6 +985,10 @@
                 fh.write(requirements3)
                 fh.chmod(0o0700)
 
+            with sftp.open('%s/requirements-py3.5.txt' % home, 'wb') as fh:
+                fh.write(requirements35)
+                fh.chmod(0o0700)
+
             print('executing bootstrap')
             chan, stdin, stdout = ssh_exec_command(
                 client, '%s/bootstrap' % home