43 references to EntrypointType
Aspire.Hosting.Python (32)
PythonAppResourceBuilderExtensions.cs (31)
58=> AddPythonAppCore(builder, name, appDirectory, EntrypointType.Script, scriptPath, DefaultVirtualEnvFolder); 89=> AddPythonAppCore(builder, name, appDirectory, EntrypointType.Script, scriptPath, DefaultVirtualEnvFolder); 120=> AddPythonAppCore(builder, name, appDirectory, EntrypointType.Module, moduleName, DefaultVirtualEnvFolder); 151=> AddPythonAppCore(builder, name, appDirectory, EntrypointType.Executable, executableName, DefaultVirtualEnvFolder); 188return AddPythonAppCore(builder, name, appDirectory, EntrypointType.Script, scriptPath, DefaultVirtualEnvFolder) 230return AddPythonAppCore(builder, name, appDirectory, EntrypointType.Script, scriptPath, virtualEnvironmentPath) 235IDistributedApplicationBuilder builder, string name, string appDirectory, EntrypointType entrypointType, 311if (entrypointType is EntrypointType.Script or EntrypointType.Module) 313var programPath = entrypointType == EntrypointType.Script 321Module = entrypointType == EntrypointType.Module ? entrypoint : null, 335if (annotation.Type == EntrypointType.Module) 346else if (annotation.Type == EntrypointType.Script) 389var entrypointType = entrypointAnnotation.Type; 395EntrypointType.Script => ["python", entrypoint], 396EntrypointType.Module => ["python", "-m", entrypoint], 397EntrypointType.Executable => [entrypoint], 453case EntrypointType.Script: 456case EntrypointType.Module: 459case EntrypointType.Executable: 532EntrypointType.Executable => virtualEnvironment.GetExecutable(entrypointAnnotation.Entrypoint), 533EntrypointType.Script or EntrypointType.Module => virtualEnvironment.GetExecutable("python"), 577this IResourceBuilder<PythonAppResource> builder, EntrypointType entrypointType, string entrypoint) 594EntrypointType.Executable => virtualEnvironment.GetExecutable(entrypoint), 595EntrypointType.Script or EntrypointType.Module => virtualEnvironment.GetExecutable("python"), 618var entrypointType = existingAnnotation.Type; 624case EntrypointType.Module: 628case EntrypointType.Script: 631case EntrypointType.Executable:
PythonEntrypointAnnotation.cs (1)
16public required EntrypointType Type { get; set; }
Aspire.Hosting.Python.Tests (11)
AddPythonAppTests.cs (11)
213Assert.Equal(EntrypointType.Script, entrypointAnnotation.Type); 621Assert.Equal(EntrypointType.Script, entrypointAnnotation.Type); 640Assert.Equal(EntrypointType.Module, entrypointAnnotation.Type); 659Assert.Equal(EntrypointType.Executable, entrypointAnnotation.Type); 844pythonBuilder.WithEntrypoint(EntrypointType.Module, "uvicorn") 854Assert.Equal(EntrypointType.Module, entrypointAnnotation.Type); 880pythonBuilder.WithEntrypoint(EntrypointType.Executable, "pytest"); 899resourceBuilder.WithEntrypoint(EntrypointType.Module, "flask")); 910builder.WithEntrypoint(EntrypointType.Module, "flask")); 924resourceBuilder.WithEntrypoint(EntrypointType.Module, null!)); 928resourceBuilder.WithEntrypoint(EntrypointType.Module, string.Empty));