-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The JSONRPC server's configure request accepts several configuration options that are not available as CLI arguments on the find and resolve commands. These should be added as explicit --flags with corresponding PET_* environment variable fallbacks (using clap's env attribute).
Missing CLI arguments
| CLI flag | Env var | Type | Commands |
|---|---|---|---|
--conda-executable |
PET_CONDA_EXECUTABLE |
Option<PathBuf> |
find |
--pipenv-executable |
PET_PIPENV_EXECUTABLE |
Option<PathBuf> |
find |
--poetry-executable |
PET_POETRY_EXECUTABLE |
Option<PathBuf> |
find |
--environment-directories |
PET_ENVIRONMENT_DIRECTORIES |
Option<Vec<PathBuf>> |
find |
Implementation approach
Use clap's env attribute so the CLI flag takes precedence, with the environment variable as a fallback:
/// Path to the conda/mamba executable.
#[arg(long, env = "PET_CONDA_EXECUTABLE")]
conda_executable: Option<PathBuf>,
/// Path to the pipenv executable.
#[arg(long, env = "PET_PIPENV_EXECUTABLE")]
pipenv_executable: Option<PathBuf>,
/// Path to the poetry executable.
#[arg(long, env = "PET_POETRY_EXECUTABLE")]
poetry_executable: Option<PathBuf>,
/// Additional directories where virtual environments can be found.
#[arg(long, env = "PET_ENVIRONMENT_DIRECTORIES", value_delimiter = ',')]
environment_directories: Option<Vec<PathBuf>>,Wire these into create_config() in crates/pet/src/lib.rs so they populate the Configuration struct the same way the JSONRPC handle_configure does.
Files to modify
crates/pet/src/main.rs— add new args to theFindcommand enum variantcrates/pet/src/lib.rs— updateFindOptionsandcreate_config()to pass the new options through toConfiguration
Notes
resolveonly needs--cache-directory(already present). The tool-specific executables are only used during discovery (find).- For list-valued env vars (e.g.
PET_ENVIRONMENT_DIRECTORIES), use,as the delimiter viavalue_delimiter = ','. - Consider also adding
PET_CACHE_DIRECTORYandPET_SEARCH_PATHSenv var fallbacks to the existing--cache-directoryand search paths args for consistency.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request