@@ -165,31 +165,31 @@ public static void AssertPythonVersion(WorkerLanguageVersionInfo pythonVersion,
165
165
{
166
166
if ( pythonVersion ? . Version == null )
167
167
{
168
- var message = "Could not find a Python version. Python 3.6.x, 3.7.x, 3.8.x, 3.9.x, or 3.10 .x is recommended, and used in Azure Functions." ;
168
+ var message = "Could not find a Python version. Python 3.6.x, 3.7.x, 3.8.x, 3.9.x, 3.10.x or 3.11 .x is recommended, and used in Azure Functions." ;
169
169
if ( errorIfNoVersion ) throw new CliException ( message ) ;
170
170
ColoredConsole . WriteLine ( WarningColor ( message ) ) ;
171
171
return ;
172
172
}
173
173
174
174
ColoredConsole . WriteLine ( AdditionalInfoColor ( $ "Found Python version { pythonVersion . Version } ({ pythonVersion . ExecutablePath } ).") ) ;
175
175
176
- // Python 3.[6|7|8|9|10] (supported)
176
+ // Python 3.[6|7|8|9|10|11 ] (supported)
177
177
if ( IsVersionSupported ( pythonVersion ) )
178
178
{
179
179
return ;
180
180
}
181
181
182
- // Python 3.x (but not 3.[6|7|8|9|10]), not recommended, may fail. E.g.: 3.4, 3.5.
182
+ // Python 3.x (but not 3.[6|7|8|9|10|11 ]), not recommended, may fail. E.g.: 3.4, 3.5.
183
183
if ( pythonVersion . Major == 3 )
184
184
{
185
185
if ( errorIfNotSupported )
186
- throw new CliException ( $ "Python 3.6.x to 3.10 .x is required for this operation. " +
187
- $ "Please install Python 3.6, 3.7, 3.8, 3.9, or 3.10 and use a virtual environment to switch to Python 3.6, 3.7, 3.8, 3.9, or 3.10 .") ;
188
- ColoredConsole . WriteLine ( WarningColor ( "Python 3.6.x, 3.7.x, 3.8.x, 3.9.x, or 3.10 .x is recommended, and used in Azure Functions." ) ) ;
186
+ throw new CliException ( $ "Python 3.6.x to 3.11 .x is required for this operation. " +
187
+ $ "Please install Python 3.6, 3.7, 3.8, 3.9, 3.10 or 3.11 and use a virtual environment to switch to Python 3.6, 3.7, 3.8, 3.9, 3.10 or 3.11 .") ;
188
+ ColoredConsole . WriteLine ( WarningColor ( "Python 3.6.x, 3.7.x, 3.8.x, 3.9.x, 3.10.x or 3.11 .x is recommended, and used in Azure Functions." ) ) ;
189
189
}
190
190
191
191
// No Python 3
192
- var error = "Python 3.x (recommended version 3.[6|7|8|9|10]) is required." ;
192
+ var error = "Python 3.x (recommended version 3.[6|7|8|9|10|11 ]) is required." ;
193
193
if ( errorIfNoVersion ) throw new CliException ( error ) ;
194
194
ColoredConsole . WriteLine ( WarningColor ( error ) ) ;
195
195
}
@@ -222,6 +222,7 @@ public static async Task<WorkerLanguageVersionInfo> GetEnvironmentPythonVersion(
222
222
var python38GetVersionTask = GetVersion ( "python3.8" ) ;
223
223
var python39GetVersionTask = GetVersion ( "python3.9" ) ;
224
224
var python310GetVersionTask = GetVersion ( "python3.10" ) ;
225
+ var python311GetVersionTask = GetVersion ( "python3.11" ) ;
225
226
226
227
var versions = new List < WorkerLanguageVersionInfo >
227
228
{
@@ -233,6 +234,7 @@ public static async Task<WorkerLanguageVersionInfo> GetEnvironmentPythonVersion(
233
234
await python38GetVersionTask ,
234
235
await python39GetVersionTask ,
235
236
await python310GetVersionTask ,
237
+ await python311GetVersionTask ,
236
238
} ;
237
239
238
240
// Highest preference -- Go through the list, if we find the first python 3.6 or python 3.7 worker, we prioritize that.
@@ -553,6 +555,8 @@ public static Task<string> GetDockerInitFileContent(WorkerLanguageVersionInfo in
553
555
return StaticResources . DockerfilePython39 ;
554
556
case 10 :
555
557
return StaticResources . DockerfilePython310 ;
558
+ case 11 :
559
+ return StaticResources . DockerfilePython311 ;
556
560
}
557
561
}
558
562
return StaticResources . DockerfilePython37 ;
@@ -574,6 +578,8 @@ private static string GetBuildNativeDepsEnvironmentImage(WorkerLanguageVersionIn
574
578
return Constants . DockerImages . LinuxPython39ImageAmd64 ;
575
579
case 10 :
576
580
return Constants . DockerImages . LinuxPython310ImageAmd64 ;
581
+ case 11 :
582
+ return Constants . DockerImages . LinuxPython311ImageAmd64 ;
577
583
}
578
584
}
579
585
return Constants . DockerImages . LinuxPython36ImageAmd64 ;
@@ -585,6 +591,7 @@ private static bool IsVersionSupported(WorkerLanguageVersionInfo info)
585
591
{
586
592
switch ( info ? . Minor )
587
593
{
594
+ case 11 :
588
595
case 10 :
589
596
case 9 :
590
597
case 8 :
0 commit comments