PythonCall.jl icon indicating copy to clipboard operation
PythonCall.jl copied to clipboard

Support uv instead of CondaPkg

Open clouds56 opened this issue 3 months ago • 3 comments

Now uv is more and more popular to manage python environment, shall we support using uv add packages instead of CondaPkg, which should make add a python package much more faster.

clouds56 avatar Sep 08 '25 23:09 clouds56

I don't think I'm going to add another backend to PythonCall because this will just fragment things.

However CondaPkg by default does now use Pixi which in turn uses uv to install any PyPI packages. It's pretty fast already.

I've also considered adding a uv backend to CondaPkg directly. However it's complicated by the fact that CondaPkg files contain a mix of Conda and PyPI packages and uv can only install the PyPI ones. And we'd still need to install python itself, although uv can also do this for us nowadays. So it's doable but personally I think the Pixi backend is plenty fast enough.

cjdoris avatar Sep 11 '25 09:09 cjdoris

it's complicated by the fact that CondaPkg files contain a mix of Conda and PyPI packages and uv can only install the PyPI ones

I don't think it's a issue. Project initialized with uv would never have deps of conda packages, and Project initialized with conda should be expected to not work well with uv.

clouds56 avatar Sep 15 '25 06:09 clouds56

The problem is that even if your project only has python dependencies, some package that you use might have conda dependencies. CondaPkg collects these all together and installs them all. So this is best handled as a uv backend in CondaPkg which will know what to do.

If you want to manage the venv yourself then #668 is a nice idea.

cjdoris avatar Sep 15 '25 10:09 cjdoris