Introduction¶
DSH is a platform that uses plugins as its core extensibility mechanism. When developing in Python, managing virtual environments often requires local shells or global tools. The dsh-uvm plugin solves environment management pain points by invoking uv directly within the DSH Web interface.
Plugin Positioning¶
This is a client-side plugin maintained by Harzva for managing Python virtual environments in DSH Web. It integrates the uv lifecycle (creation, installation, synchronization, and execution) into DSH’s native UI, and provides fallback support for pip and read-only visibility for conda environments.
Core Capabilities¶
- Environment lifecycle management: Supports creating and deleting virtual environments, and reads
pyvenv.cfgunder the environment root directory to list environment information. - Toolchain detection: Automatically detects local paths and versions for
uv,python3 -m pip, andconda. - Package management: Supports installing and uninstalling packages in a specified environment, and synchronizes
requirementsfiles. - Project synchronization: Provides dependency difference previews (M2) for local projects by comparing
pyproject.tomlwith installed packages. - Environment execution: Supports running
pythonorpipcommands in plugin-managed environments, with a 60-second timeout and a 512KB output limit. - Conda visibility: Displays the
condaenvironment list only; no write operations are performed.
Installation and Activation¶
You can install it using the officially provided command.
dsh plugin --profile web add github:Harzva/dsh-uvm
To build from source, follow these steps:
git clone https://github.com/Harzva/dsh-uvm.git
cd dsh-uvm
pnpm install --frozen-lockfile
pnpm check
pnpm run pack:dsh
dsh plugin --profile web add ./artifacts/harness-flow-dsh-uvm-0.1.0-alpha.1.tgz
dsh web
Notes and Boundaries¶
This is an unofficial plugin, and all operations are performed locally only.
* Write restrictions: All write operations are strictly limited to the environment root directory (default: ~/.dsh-uvm/envs).
* Security mechanisms: Routes only accept loopback and same-origin requests; child processes are invoked using a spawn argument array without going through a shell; environment names must match [A-Za-z0-9][A-Za-z0-9._-]{0,63}.
* Data privacy: The plugin does not read DSH sessions, credentials, or other user directories.
Conclusion¶
dsh-uvm provides a standardized virtual environment management solution for users who need to work on Python development within the DSH environment. For more details and source code, see its GitHub repository: https://github.com/Harzva/dsh-uvm