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)
341virtualEnvironmentPath, (n, e, d) => new PythonAppResource(n, e, d));
Aspire.Hosting.Python.Tests (4)
AddPythonAppTests.cs (1)
1202var 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)
68public static IResourceBuilder<PythonAppResource> AddPythonApp( 106public static IResourceBuilder<PythonAppResource> AddPythonModule( 147public static IResourceBuilder<PythonAppResource> AddPythonExecutable( 181public static IResourceBuilder<PythonAppResource> AddPythonApp( 223public static IResourceBuilder<PythonAppResource> AddPythonApp( 336private static IResourceBuilder<PythonAppResource> AddPythonAppCore( 346string entrypoint, string virtualEnvironmentPath, Func<string, string, string, T> createResource) where T : PythonAppResource 528private static void GenerateUvDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 588var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 633private static void GenerateFallbackDockerfile(DockerfileBuilderCallbackContext context, PythonAppResource resource, 644var logger = context.Services.GetService<ILogger<PythonAppResource>>(); 864this IResourceBuilder<T> builder, string virtualEnvironmentPath, bool createIfNotExists = true) where T : PythonAppResource 925this IResourceBuilder<T> builder) where T : PythonAppResource 1037this IResourceBuilder<T> builder, EntrypointType entrypointType, string entrypoint) where T : PythonAppResource 1105/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1137where T : PythonAppResource 1188/// <typeparam name="T">The type of the Python application resource, must derive from <see cref="PythonAppResource"/>.</typeparam> 1235where T : PythonAppResource 1294private static void AddInstaller<T>(IResourceBuilder<T> builder, bool install) where T : PythonAppResource 1362private static void CreateVenvCreatorIfNeeded<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1418private static void RemoveVenvCreator<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1430private static void SetupDependencies(IDistributedApplicationBuilder builder, PythonAppResource resource) 1443builder.TryCreateResourceBuilder<PythonAppResource>(resource.Name, out var appBuilder); 1487private static bool ShouldCreateVenv<T>(IResourceBuilder<T> builder) where T : PythonAppResource 1525internal 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)
160var pythonProjectResource = executableResources.OfType<PythonAppResource>().Single(); 199var pythonProjectResource = executableResources.OfType<PythonAppResource>().Single(); 218var resource = appModel.Resources.OfType<PythonAppResource>().Single(); 242var 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>()); 542var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 578var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 627var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 662var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 705var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 792var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 804IResourceBuilder<PythonAppResource> builder = null!; 928var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 947var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 966var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 988var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1024var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1058var pythonProjectResource = Assert.Single(executableResources.OfType<PythonAppResource>()); 1089var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1113var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1135var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1161var resource = Assert.Single(appModel.Resources.OfType<PythonAppResource>()); 1202var resource = new PythonAppResource("test", "python", "/tmp"); 1214IResourceBuilder<PythonAppResource> builder = null!; 1409var resource = pythonApp.Resource; 1453var resource = pythonApp.Resource; 1493var resource = pythonApp.Resource; 1665var resource = pythonApp.Resource; 1696var resource = pythonApp.Resource; 2499var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single(); 2532var pythonAppResource = appModel.Resources.OfType<PythonAppResource>().Single();