csspin_python.uv_provisioner
The uv_provisioner plugin can be used to change the way the
csspin_python.python creates the virtual environment and installs the
Python packages into it. To do so, the plugin uses uv.
How to setup the uv_provisioner plugin?
For using the uv_provisioner plugin, a project’s spinfile.yaml must at
least contain the following configuration. Note, that the uv extra of the
csspin-python plugin-package must be installed for the plugin to work.
spinfile.yaml to leverage the uv_provisionerplugin_packages:
- csspin-python[uv]
plugins:
- csspin_python:
- uv_provisioner
python:
version: "3.11.9"
uv_provisioner:
enabled: true
The provisioning of the required virtual environment as well as the plugins
dependencies can be done via the well-known spin provision-task.
Things to watch out for when using the uv_provisioner plugin
Index URL
When using the uv_provisioner plugin you must make sure to set
python.index_url so that it points to a simple index.
Windows Defender
Windows Defender is quite aggressive about uv, which comes to show
especially during spin provision when the uv_provisioner is installing
the Python packages.
To speed this up you can exclude the following directories from Windows Defender. Please note that this comes with additional security risks. Please also consult the documentation from Microsoft in the matter, since excluding temporary directories is considered unsafe:
%LOCALAPPDATA%\uv\cache%TEMP%%TMP%%TMPDIR%
csspin_python.uv_provisioner schema reference
- uv_provisioner: 'object'
Configuration of the csspin_python.uv plugin
- uv_provisioner.enabled: 'bool'
Used to let the python plugin use the SimpleUvProvisioner to provision the python environment.
- uv_provisioner.uv_python_data: 'path'
The directory where the python interpreters uv provisions are being stored.
- uv_provisioner.uv_toml_path: 'path'
Path to uv’s config file
- uv_provisioner.uv_toml: 'str'
Content for uv’s config file
- uv_provisioner.schema: 'object'
- uv_provisioner.requires: 'object'
- uv_provisioner.requires.spin: 'list'
- uv_provisioner._requires: 'list'