<@UQ8NE6A86> did you come to any decision on publi...
# datascience
f
@Ilya Muradyan did you come to any decision on publishing the Kotlin Kernel as a package? I am currently setting up automatic builds of my plugin that depends on the Kotlin kernel. I can just use the workaround I have been using before and grab the libraries from the Python package, but that is a bit inelegant.
i
Do you need a package with kernel in its current form or some API changes are required?
f
current Form should be fine. Currently I am installing the python packaging and just copying the
jar
files from
.local/lib/python3.9/site-packages/run_kotlin_kernel/jars/*
to the location that the buildscript of my plugin expects them to be
i
Ok, I may add a publication for kernel package then. I'll publish it in Central along with other Kotlin kernel packages: https://search.maven.org/search?q=kotlin-jupyter
ETA is today-tomorrow
f
Thank you very much!
Please try it out and let me know if everything is fine
f
It seems like just using maven isn't enough because the kernel requires the
khttp
library which isn't on maven yet. But
khttp
was never on the
run_kotlin_kernel/jars
folder, so I am not sure if it is required?
i
It is required. In kernel installation khttp is shadowed into the fat JAR. Just add
jcenter()
into your
repositories
section. It seems that we need to contact khttp author and ask him to publish it on Central
f
Ah, that works too. The documentation at https://github.com/Kotlin/kotlin-jupyter/blob/3c0d1cf891b6c8ea5606768fc3e9ce4bb5ef34a3/jupyter-lib/shared-compiler/build.gradle.kts#L43 implies this is just for remote library dependency resolving which I think is something that isn't required in my use case anyway. But might as well include it for now
Huh, what is the reason the package names differ? i.e. when simply coping the libs from the python package the package path for the kernel entry is
org.jetbrains.kotlin.jupyter.IkotlinKt
but the libraries downloaded via maven have the class at the path
org/jetbrains/kotlinx/jupyter/IkotlinKt.class
Is this intentional and something I need to change in my code that uses the kernel or an indication that I am doing something else wrong?
Ah, the current code as published on maven is simply newer than the compiled code included in the Python package. So I just need to update my code accordingly
Okay, I think this is the last issue, but I am somewhat stumped: My call to the
embedKernel
method currently looks like this: https://github.com/GhidraJupyter/ghidra-jupyter-kotlin/blob/main/GhidraJupyterKotl[…]in/src/main/java/GhidraJupyterKotlin/KotlinQtConsoleThread.java i.e. passes
null
to what used to be the
libraryFactory
. You refactored this as part of https://github.com/Kotlin/kotlin-jupyter/commit/782f0882ed5f9e89ad378b4a986591397027721d#diff-3c1c4b1ddbb3338fe28601f[…]95dafb1c3ad4b60a8ffeedc62R85 Now the value isn't nullable anymore, and the obvious solution would be to pass
EmptyResolutionInfoProvider
. But for reasons that I don't fully understand I can't import
EmptyResolutionInfoProvider
from java code. My best guess is that this is because it is actually a singleton object and this can't be simply imported like a class in java https://github.com/Kotlin/kotlin-jupyter/blob/dd04fadbe693447c854b4b7668d9d1c4c30c[…]g/jetbrains/kotlinx/jupyter/libraries/ResolutionInfoProvider.kt is there some way to properly import this in Java, or would the signature of
embedKernel
need to be changed?
i
@Florian Magin I believe you need to refer the object like
Copy code
EmptyResolutionInfoProvider.INSTANCE
f
ah, that does seem to work. Couldn't find any documentation on it, despite around 10 minutes of searching around
Can confirm that this is enough, and I can now build my application by just declaring the kotlin kernel as a dependency. Thank you!
@Ilya Muradyan is there some way to correlate the Maven releases with git commits? I assume the versions 0.8.3.241 and above that appeared yesterday are the the new changes I needed, but this seems somewhat hard to track. How do releases to maven currently work (roughly, mostly if you are doing them manually or if they just run for every new commit to master)
i
They run for every commit in master, every commit has the corresponding version, but version tags are only pushed for "release" versions (which are published to stable Conda and pip channels). The list of tags is here: https://github.com/Kotlin/kotlin-jupyter/tags Last release version is
0.8.3.122