PythonAppResourceBuilderExtensions
Class static net10.0
Provides extension methods for adding Python applications to an
Hosting.IDistributedApplicationBuilder. namespace Aspire.Hosting;
public static class PythonAppResourceBuilderExtensions{ // ...} 11 members
Methods11
Section titled MethodsAddPythonApp(IDistributedApplicationBuilder, string, string, string)extensionIResourceBuilder<PythonAppResource> Adds a Python application to the application model.
AddPythonApp(IDistributedApplicationBuilder, string, string, string, string[])extensionobsoleteIResourceBuilder<PythonAppResource> Adds a python application with a virtual environment to the application model.
AddPythonApp(IDistributedApplicationBuilder, string, string, string, string, string[])extensionobsoleteIResourceBuilder<PythonAppResource> Adds a python application with a virtual environment to the application model.
AddPythonExecutable(IDistributedApplicationBuilder, string, string, string)extensionIResourceBuilder<PythonAppResource> Adds a Python executable to the application model.
AddPythonModule(IDistributedApplicationBuilder, string, string, string)extensionIResourceBuilder<PythonAppResource> Adds a Python module to the application model.
AddUvicornApp(IDistributedApplicationBuilder, string, string, string)extensionIResourceBuilder<UvicornAppResource> Adds a Uvicorn-based Python application to the distributed application builder with HTTP endpoint configuration.
WithDebugging(IResourceBuilder<T>)extensionIResourceBuilder<T> Enables debugging support for the Python application.
WithEntrypoint(IResourceBuilder<T>, EntrypointType, string)extensionIResourceBuilder<T> Configures the entrypoint for the Python application.
WithPip(IResourceBuilder<T>, bool, string[]?)extensionIResourceBuilder<T> Configures the Python resource to use pip as the package manager and optionally installs packages before the application starts.
WithUv(IResourceBuilder<T>, bool, string[]?)extensionIResourceBuilder<T> Adds a UV environment setup task to ensure the virtual environment exists before running the Python application.
WithVirtualEnvironment(IResourceBuilder<T>, string, bool)extensionIResourceBuilder<T> Configures a custom virtual environment path for the Python application.