Skip to content

Conversation

Jolanrensen
Copy link
Collaborator

Fixes #1140

Adds libraries.json which loads dataframe-jupyter from dataframe-core in notebooks. Requires Kotlin/kotlin-jupyter#488.

TODO: Wait for the above PR to be merged and published. Adding this new argument will break existing kernels due to the "descriptors" argument being unknown.

@Jolanrensen
Copy link
Collaborator Author

Kotlin/kotlin-jupyter#488 was merged, however, there's still the issue of providing "unsupported keys" in libraries.json for current kernels. Let's wait until Beta 4 to merge this PR, so people have a chance to bump kernel versions first.

@Jolanrensen Jolanrensen marked this pull request as ready for review September 16, 2025 09:39
"descriptors": [
{
"init": [
"@Suppress(\"INVISIBLE_MEMBER\", \"INVISIBLE_REFERENCE\") USE { dependencies(\"org.jetbrains.kotlinx:dataframe-jupyter:${org.jetbrains.kotlinx.dataframe.BuildConfig.VERSION}\") }"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make it public or semi-hidden through some hacks? This suppress warning can break in future versions of kotlin

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's internal, so basically semi-hidden, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion we could also add it to a companion object of DataFrame, like DataFrame.VERSION; doesn't even need to be hidden

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semi hidden but also avoid suppressing invisible reference :)
DataFrame.VERSION idk, not worth to pollute IO scope with it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might not need it after all :) Currently, the tests in dataframe-jupyter are failing because the libraries.json is in the classpath. I'm trying to generate and include it on the fly upon publishing only

@Jolanrensen
Copy link
Collaborator Author

Jolanrensen commented Sep 16, 2025

wow that's a lot of failing tests all of a sudden, let me check..

...of course... the tests are trying to load the META-INF file from :core using a VERSION that doesn't exist. This file should be ignored by the tests

@Jolanrensen
Copy link
Collaborator Author

Okay, I removed the libraries.json file from the resources. Now it's only added upon publishing, similar to running KoDEx only upon publishing. That way the tests that depend on :core don't have to deal with the file and potentially try to load a version of dataframe-jupyter that doesn't exit.

@Jolanrensen Jolanrensen marked this pull request as draft September 17, 2025 10:48
@Jolanrensen
Copy link
Collaborator Author

"upon publishing" is not a good idea. It's still triggered from some integration tests that call publishToMavenLocal. This is likely why #1034 was necessary.

Instead, I added a new gradle parameter includeCoreLibrariesJson similar to skipKodex. Our publisher calls it already:
https://jetbrains.team/p/kds/repositories/kotlin-ds-teamcity-config/revision/d170537ce93ed7ca9292efeecefb706e604c65fe

I ran a test-run of publish-dev and it seems to both build/test fine and publish with the json file included:
image

@Jolanrensen Jolanrensen marked this pull request as ready for review September 17, 2025 16:10
@Jolanrensen Jolanrensen merged commit 938a88f into master Sep 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notebook with project dependencies can end up without loaded Jupyter integration
3 participants