utils¶
Utility functions for mcpup.
ensure_uv_installed ¶
Check if uv is installed and available in the PATH.
Returns:
| Type | Description |
|---|---|
bool
|
True if uv is installed, False otherwise |
Source code in src/mcpup/utils.py
run_with_package ¶
Run a command with a package installed using uv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_name
|
str
|
Name of the package to install |
required |
command
|
list
|
Command to run |
required |
Returns:
| Type | Description |
|---|---|
CompletedProcess
|
CompletedProcess instance with command results |
Source code in src/mcpup/utils.py
sanitize_path ¶
Convert a module path to a valid filesystem path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Module path (e.g., 'package.submodule') |
required |
Returns:
| Type | Description |
|---|---|
str
|
Sanitized path suitable for filesystem use |