I have a package with a dependency that should be there by default. I also have an optional dependency which should override the first one. Is this possible?
The use case is onnxruntime
as a dependency and onnxruntime-gpu
as an extra dependency when building for gpu
. The issue is that onnxruntime-gpu
cannot co-exist with onnxruntime
(well it can, but GPU won’t actually work - onnxruntime-gpu
has to be installed on its own)
So if I have something like this:
dependencies = [ "onnxruntime"]
[project.optional-dependencies]
gpu = [ "onnxruntime-gpu"]
this wouldn’t work as it would install both.
I could do something like this
dependencies = []
[project.optional-dependencies]
gpu = [ "onnxruntime-gpu"]
cpu = [ "onnxruntime"]
But then pip install mypackage
would result in an incomplete environment. If that’s the best option, then that’s fine but thought I’d ask.