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)
339virtualEnvironmentPath, (n, e, d) => new PythonAppResource(n, e, d));
Aspire.Hosting.Python.Tests (4)
AddPythonAppTests.cs (1)
1201var 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( 104public static IResourceBuilder<PythonAppResource> AddPythonModule( 145public static IResourceBuilder<PythonAppResource> AddPythonExecutable( 179public static IResourceBuilder<PythonAppResource> AddPythonApp( 221public static IResourceBuilder<PythonAppResource> AddPythonApp( 334private static IResourceBuilder<PythonAppResource> AddPythonAppCore( 344string entrypoint, string virtualEnvironmentPath, Func<string, string, string, T> createResource) where T : PythonAppResource 526private static void GenerateUvDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 586var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 631private static void GenerateFallbackDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 642var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 862this IResourceBuilder<T> builder, string virtualEnvironmentPath, bool createIfNotExists = true) where T : PythonAppResource 923this IResourceBuilder<T> builder) where T : PythonAppResource 1035this IResourceBuilder<T> builder, EntrypointType entrypointType, string entrypoint) where T : PythonAppResource 1103/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1135where T : PythonAppResource 1186/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1233where T : PythonAppResource 1292private static void AddInstaller<T>(IResourceBuilder<T> builder, bool install) where T : PythonAppResource 1360private static void CreateVenvCreatorIfNeeded<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1416private static void RemoveVenvCreator<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1428private static void SetupDependencies(IDistributedApplicationBuilder builder, PythonAppResource resource) 1441builder.TryCreateResourceBuilder<PythonAppResource>(resource.Name, out var appBuilder); 1485private static bool ShouldCreateVenv<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1523internal 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(); 416var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 449var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 467IResourceBuilder<PythonAppResource> builder = null!; 510var 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>()); 661var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 704var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 791var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 803IResourceBuilder<PythonAppResource> builder = null!; 927var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 946var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 965var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 987var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1023var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1057var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1088var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1112var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1134var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1160var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1201var resource = new PythonAppResource("test", "python", "/tmp"); 1213IResourceBuilder<PythonAppResource> builder = null!; 1408var resource = pythonApp.Resource; 1452var resource = pythonApp.Resource; 1492var resource = pythonApp.Resource; 1664var resource = pythonApp.Resource; 1695var resource = pythonApp.Resource; 2498var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 2531var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single();