Suzhou-Tongyuan / jnumpy

Writing Python C extensions in Julia within 5 minutes.
MIT License
234 stars 8 forks source link

verbose mode for `init_jl` and `init_project()` #71

Open thautwarm opened 1 year ago

thautwarm commented 1 year ago

Tonight we encountered an issue that users didn't have write permission to site-packages, while JNumPy reported no error and exited without any meaningful message.

Considering this, we shall add support for such extreme cases. The api changes could be init_jl(verbose=True) and init_project(__file__, verbose=True).

For the implementation part, utility functions in InitTools should also take the verbose::Bool argument.

songjhaha commented 1 year ago

I think error message didn't show up because here use_gil=False, so we didn't capture error. https://github.com/Suzhou-Tongyuan/jnumpy/blob/89f1c6f863c26ac372b6a29fd39b598e03d1b240/jnumpy/apis.py#L43-L56

But when init_jl() we haven't init TyPython so we still need some solutions to capture error

songjhaha commented 1 year ago

Verbose mode didn't solve the error message problem, but it could be useful if user wants to startup jnumpy project silently. With default setting, we show the progress of julia installing package, because user should know what jnumpy is doing, maybe it's stuck in the step installing some package and takes a long time.