PythonAppResource
type PythonAppResource interface { IComputeResource IContainerFilesDestinationResource Resource ResourceWithArgs ResourceWithEndpoints ResourceWithEnvironment ResourceWithWaitSupport}Methods
WithDebugging() PythonAppResourceReturns
PythonAppResource The resource builder.
Returns a handle; failures surface later via Err().
WithEntrypoint( entrypointType EntrypointType, entrypoint string,) PythonAppResourceParameters
entrypointType EntrypointType The type of entrypoint (Script, Module, or Executable).entrypointstringThe entrypoint value (script path, module name, or executable name).Returns
PythonAppResource The resource builder.
Returns a handle; failures surface later via Err().
WithPip(options ...*WithPipOptions) PythonAppResourceParameters
options...*WithPipOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithPipOptions argument.
Install*boolWhen true (default), automatically installs packages before the application starts. When false, only sets the package manager annotation without creating an installer resource.InstallArgs []string The command-line arguments passed to pip install command.Returns
PythonAppResource The resource builder.
Returns a handle; failures surface later via Err().
WithUv(options ...*WithUvOptions) PythonAppResourceParameters
options...*WithUvOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithUvOptions argument.
Install*boolWhen true (default), automatically runs uv sync before the application starts. When false, only sets the package manager annotation without creating an installer resource.Args[]string Optional custom arguments to pass to the uv command. If not provided, defaults to ["sync"].Returns
PythonAppResource The resource builder.
Returns a handle; failures surface later via Err().
WithVirtualEnvironment( virtualEnvironmentPath string, options ...*WithVirtualEnvironmentOptions,) PythonAppResourceParameters
virtualEnvironmentPath stringThe path to the virtual environment. Can be absolute or relative to the app directory. When relative, it is resolved from the working directory of the Python application. Common values include ".venv", "venv", or "myenv".options...*WithVirtualEnvironmentOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithVirtualEnvironmentOptions argument.
CreateIfNotExists *boolWhether to automatically create the virtual environment if it doesn't exist. Defaults to true. Set to false to disable automatic venv creation (the venv must already exist).Returns
PythonAppResource The resource builder.
Returns a handle; failures surface later via Err().