Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithUv

Method
📦 Aspire.Hosting.Python v17.0.0
func (PythonAppResource) WithUv(options ...*WithUvOptions) PythonAppResource

Signature

methodWithUvbuilder
Adds a UV environment setup task to ensure the virtual environment exists before running the Python application.
WithUv(options ...*WithUvOptions) PythonAppResource
options...*WithUvOptionsOptional settings, described under 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[]stringOptional custom arguments to pass to the uv command. If not provided, defaults to ["sync"].
PythonAppResource

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: