@@ -95,7 +95,7 @@ var _ = Describe("Supply", func() {
9595 pythonInstallDir = filepath .Join (depDir , "python" )
9696 Expect (os .WriteFile (filepath .Join (depDir , "runtime.txt" ), []byte ("\n \n \n python-3.4.2\n \n \n " ), 0644 )).To (Succeed ())
9797
98- versions = []string {"3.4.2" }
98+ versions = []string {"3.4.2" , "3.7.13" }
9999 originalPath = os .Getenv ("PATH" )
100100 })
101101
@@ -116,6 +116,24 @@ var _ = Describe("Supply", func() {
116116 })
117117 })
118118
119+ //Remove once Python 3.7 is out of support (June 2023)
120+ Context ("runtime.txt sets Python version 3.7" , func () {
121+ BeforeEach (func () {
122+ Expect (os .RemoveAll (filepath .Join (depDir , "runtime.txt" ))).To (Succeed ())
123+ Expect (os .WriteFile (filepath .Join (depDir , "runtime.txt" ), []byte ("\n \n \n python-3.7.13\n \n \n " ), 0644 )).To (Succeed ())
124+ })
125+ It ("installs Python version 3.7" , func () {
126+ mockManifest .EXPECT ().AllDependencyVersions ("python" ).Return (versions )
127+ mockInstaller .EXPECT ().InstallDependency (libbuildpack.Dependency {Name : "python" , Version : "3.7.13" }, pythonInstallDir )
128+ mockStager .EXPECT ().LinkDirectoryInDepDir (filepath .Join (pythonInstallDir , "bin" ), "bin" )
129+ mockStager .EXPECT ().LinkDirectoryInDepDir (filepath .Join (pythonInstallDir , "lib" ), "lib" )
130+ Expect (supplier .InstallPython ()).To (Succeed ())
131+ Expect (os .Getenv ("PATH" )).To (Equal (fmt .Sprintf ("%s:%s" , filepath .Join (depDir , "bin" ), originalPath )))
132+ Expect (os .Getenv ("PYTHONPATH" )).To (Equal (depDir ))
133+ Expect (os .Getenv ("CFLAGS" )).To (Equal (fmt .Sprintf ("-I%s" , filepath .Join (depDir , "python" , "include" , "python3.7m" ))))
134+ })
135+ })
136+
119137 Context ("no runtime.txt is provided" , func () {
120138 BeforeEach (func () {
121139 Expect (os .RemoveAll (filepath .Join (depDir , "runtime.txt" ))).To (Succeed ())
0 commit comments