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)
355virtualEnvironmentPath, (n, e, d) => new PythonAppResource(n, e, d));
Aspire.Hosting.Python.Tests (4)
AddPythonAppTests.cs (1)
1193var 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( 101public static IResourceBuilder<PythonAppResource> AddPythonModule( 139public static IResourceBuilder<PythonAppResource> AddPythonExecutable( 173public static IResourceBuilder<PythonAppResource> AddPythonApp( 215public static IResourceBuilder<PythonAppResource> AddPythonApp( 350private static IResourceBuilder<PythonAppResource> AddPythonAppCore( 360string entrypoint, string virtualEnvironmentPath, Func<string, string, string, T> createResource) where T : PythonAppResource 544private static void GenerateUvDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 604var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 649private static void GenerateFallbackDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 660var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 878this IResourceBuilder<T> builder, string virtualEnvironmentPath, bool createIfNotExists = true) where T : PythonAppResource 937this IResourceBuilder<T> builder) where T : PythonAppResource 1065this IResourceBuilder<T> builder, EntrypointType entrypointType, string entrypoint) where T : PythonAppResource 1131/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1161where T : PythonAppResource 1212/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1257where T : PythonAppResource 1319private static void AddInstaller<T>(IResourceBuilder<T> builder, bool install) where T : PythonAppResource 1393private static void CreateVenvCreatorIfNeeded<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1453private static void RemoveVenvCreator<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1465private static void SetupDependencies(IDistributedApplicationBuilder builder, PythonAppResource resource) 1478builder.TryCreateResourceBuilder<PythonAppResource>(resource.Name, out var appBuilder); 1522private static bool ShouldCreateVenv<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1560internal 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>()); 574var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 619var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 653var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 692var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 779var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 791IResourceBuilder<PythonAppResource> builder = null!; 915var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 934var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 953var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 975var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1011var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1045var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1076var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1100var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1122var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1148var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1193var resource = new PythonAppResource("test", "python", "/tmp"); 1205IResourceBuilder<PythonAppResource> builder = null!; 1398var resource = pythonApp.Resource; 1436var resource = pythonApp.Resource; 1476var resource = pythonApp.Resource; 1513var resource = pythonApp.Resource; 1544var resource = pythonApp.Resource; 2342var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 2375var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single();