Open PatrickAlphaC opened 2 hours ago
Did you activate the virtual environment in .venv
prior to running mox --help
?
@charliermarsh yes. I can send a video if that's helpful?
Sure, anything to help reproduce would be appreciated.
I also updated the original issue so that the steps are more specific (included the virtual environment setup to make reproducing it more straightforward)
Thanks for this, it helps a lot.
I think the issue here is that uv add moccasin
does not install into the activated virtual environment (hence the warning you're seeing). It installs into the .venv
in the current directory, by design. So you need to activate the environment in the current directory in order to add the executable to the PATH. It's configurable here (https://docs.astral.sh/uv/concepts/projects/#project-environments) though that's intended for deployment environments like Docker containers.
Let's say I add the following package that is a CLI:
First, let's setup and activate a virtual environment.
Then, add our package that has an executable.
Assuming
moccasin
has an executable namedmox
, if I do the above, I am able to run the tool with:However, I cannot do:
By itself. If I instead run:
I am then able to run it's executable in the virtual environment without
uv run
:It would be nice if
uv add
had a flag to expose the executable without callinguv run
. Maybe like:Or something.