1 type derived from PythonAppResource
Aspire.Hosting.Python (1)
UvicornAppResource.cs (1)
28: PythonAppResource(name, executablePath, appDirectory);
5 instantiations of PythonAppResource
Aspire.Hosting.Python (1)
PythonAppResourceBuilderExtensions.cs (1)
335virtualEnvironmentPath, (n, e, d) => new PythonAppResource(n, e, d));
Aspire.Hosting.Python.Tests (4)
AddPythonAppTests.cs (1)
1204var resource = new PythonAppResource("test", "python", "/tmp");
PythonPublicApiTests.cs (3)
21var action = () => new PythonAppResource(name, executablePath, appDirectory); 38var action = () => new PythonAppResource(name, executablePath, appDirectory); 52var action = () => new PythonAppResource(name, executablePath, appDirectory: null!);
87 references to PythonAppResource
Aspire.Hosting.Python (28)
PythonAppResourceBuilderExtensions.cs (26)
66public static IResourceBuilder<PythonAppResource> AddPythonApp( 102public static IResourceBuilder<PythonAppResource> AddPythonModule( 141public static IResourceBuilder<PythonAppResource> AddPythonExecutable( 175public static IResourceBuilder<PythonAppResource> AddPythonApp( 217public static IResourceBuilder<PythonAppResource> AddPythonApp( 330private static IResourceBuilder<PythonAppResource> AddPythonAppCore( 340string entrypoint, string virtualEnvironmentPath, Func<string, string, string, T> createResource) where T : PythonAppResource 522private static void GenerateUvDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 582var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 627private static void GenerateFallbackDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 638var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 857this IResourceBuilder<T> builder, string virtualEnvironmentPath, bool createIfNotExists = true) where T : PythonAppResource 917this IResourceBuilder<T> builder) where T : PythonAppResource 1046this IResourceBuilder<T> builder, EntrypointType entrypointType, string entrypoint) where T : PythonAppResource 1112/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1143where T : PythonAppResource 1194/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1240where T : PythonAppResource 1299private static void AddInstaller<T>(IResourceBuilder<T> builder, bool install) where T : PythonAppResource 1366private static void CreateVenvCreatorIfNeeded<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1421private static void RemoveVenvCreator<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1433private static void SetupDependencies(IDistributedApplicationBuilder builder, PythonAppResource resource) 1446builder.TryCreateResourceBuilder<PythonAppResource>(resource.Name, out var appBuilder); 1490private static bool ShouldCreateVenv<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1528internal static IResourceBuilder<PythonAppResource> WithPythonEnvironment(this IResourceBuilder<PythonAppResource> builder, Action<PythonEnvironmentAnnotation> configure)
PythonInstallerResource.cs (1)
13internal sealed class PythonInstallerResource(string name, PythonAppResource parent)
PythonVenvCreatorResource.cs (1)
14internal sealed class PythonVenvCreatorResource(string name, PythonAppResource parent, string venvPath)
Aspire.Hosting.Python.Tests (59)
AddPythonAppTests.cs (59)
159var pythonProjectResource = executableResources.OfType<PythonAppResource>().Single(); 198var pythonProjectResource = executableResources.OfType<PythonAppResource>().Single(); 217var resource = appModel.Resources.OfType<PythonAppResource>().Single(); 241var pythonProjectResource = executableResources.OfType<PythonAppResource>().Single(); 417var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 450var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 468IResourceBuilder<PythonAppResource> builder = null!; 511var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 541var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 577var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 626var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 660var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 703var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 790var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 802IResourceBuilder<PythonAppResource> builder = null!; 926var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 945var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 964var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 986var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1022var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1056var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1087var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1111var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1133var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1159var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1204var resource = new PythonAppResource("test", "python", "/tmp"); 1216IResourceBuilder<PythonAppResource> builder = null!; 1409var resource = pythonApp.Resource; 1447var resource = pythonApp.Resource; 1487var resource = pythonApp.Resource; 1524var resource = pythonApp.Resource; 1555var resource = pythonApp.Resource; 2353var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 2386var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single();