Image-Py/sknw

Make numba an optional dependency

JayFoxRox opened this issue ยท 3 comments

I tried to install this, but I get the following, while installing numba (during installation of its llvmlite dependency):

    RuntimeError: Building llvmlite requires LLVM 7.0+ Be sure to set LLVM_CONFIG to the right executable path.

This is because my system only has LLVM 9 which isn't supported by llvmlite (used in numba) yet.
Additionally, I use Python 3.8, which also isn't supported by numba yet.

I checked the source-code for this project, and it only seems to use numba to improve performance. This project itself doesn't seem to have anything that prevents Python 3.8 or would even require the LLVM dependency (other numba).

I assume that even reduced performance would be fine for me. However, due to the numba dependency, I can't run this project at all. If numba was an optional dependency, this wouldn't be an issue.

the numba.jit is a decorator function, you can give a python format.

# from numba import jit
def jit(f): return f
...

that is will be ok!

and I did not update this repo for a long time, since numba has update much, I would try to review sknw soon!

@JayFoxRox Hi, now sknw can work with the new version numba, have a try!

I don't need to use sknw anymore, so I can't / won't test this.

I had already locally applied the same fix you had suggested to work around the issue (actually I came up with it myself independently; I had the same code in a custom numba/__init__.py so it would automatically work).

I still think that numba should be an optional dependency; it just adds a lot of dependencies and bloat for little benefit (for some users).