How to add extra to a dependency of a tool?
I installed a tool use requests.
I want to use requests[socks] instead of the default requests package. I have tried the following commands:
uv tool install open-webui --with requests[socks]
uv tool install open-webui --with requests --optional socks
uv tool upgrade open-webui --reinstall-package requests[socks]
....
Finally, could you please confirm whether it's necessary for uv tool to support adding extras to dependencies?
uv tool install open-webui --with 'requests[socks]' should work — did it not?
e.g.
❯ uv tool install black --with 'requests[socks]'
Resolved 12 packages in 4ms
Installed 12 packages in 10ms
+ black==24.10.0
+ certifi==2024.8.30
+ charset-normalizer==3.4.0
+ click==8.1.7
+ idna==3.10
+ mypy-extensions==1.0.0
+ packaging==24.1
+ pathspec==0.12.1
+ platformdirs==4.3.6
+ pysocks==1.7.1
+ requests==2.32.3
+ urllib3==2.2.3
Installed 2 executables: black, blackd
Sort of related: I installed xonsh using uv, then some plugins (xontribs) using xonsh's own manager, which amounts to installing new packages in the environment. Upon xonsh tool upgrade xonsh, it removed these extra packages. Is there a way to specify a list of packages that should be kept in the environment?
Edit: You can edit ~/.local/share/uv/tools/xonsh/uv-receipt.toml to change what packages are included but it's undocumented (so I suspect subject to change) and not the most ergonomic.
uv tool install open-webui --with 'requests[socks]'
Thank you, I would like to suggest adding this to the documentation.
https://docs.astral.sh/uv/concepts/tools/#including-additional-dependencies
Oh, sorry, coming from pipx, I looked up the keyword "inject"...