jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
9.46k stars 265 forks source link

uvx --with-requirements #2722

Open KyleKing opened 2 hours ago

KyleKing commented 2 hours ago

I have a use case where I want uv tool dependencies to be specified like uvx --with-requirements=requirements-mdformat.txt mdformat. A similar idea to expand CLI argument support was floated for pipx to support --preinstall in https://github.com/jdx/mise/issues/2491#issuecomment-2322629056, but adding either of these arguments would cause the tools to diverge.

With how uvx works, an alternative might be an alias that is directory-specific and unloaded (e.g. alias mdformat="uvx --with-requirements=requirements-mdformat.txt mdformat"). This is probably possible today combining direnv (or mise) to set directory specific environment variables and a shell function that reads these variables to build the uvx command

KyleKing commented 2 hours ago

Maybe what could address this request is a more general install-options Tool Option to specify a list of CLI arguments that are passed to the "install" invocation of the backend? Rather than explicitly specifying options?