Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] inline magic for automatically resolving libraries from Maven #476

Open
gaplo917 opened this issue Feb 8, 2025 · 0 comments
Open

Comments

@gaplo917
Copy link

gaplo917 commented Feb 8, 2025

Objective

  • Improve developer experience on handling Kotlin dependencies.
  • Kotlin Notebook for general purpose

Existing %use design

I am an experience Kotlin/JVM users and building general purpose Kotlin Notebooks. When I am new to Kotlin Notebook and reading the following inline magic, it is not clear to me about what to resolve in dataframe.

%use dataframe

It is actually controlled by another repository that resolved to org.jetbrains.kotlinx in 0.15.0 version.

{
  "description": "Kotlin framework for structured data processing",
  "properties": [
    { "name": "v", "value": "0.15.0" },
    { "name": "v-renovate-hint", "value": "update: package=org.jetbrains.kotlinx:dataframe" }
  ],
  "link": "https://github.com/Kotlin/dataframe",
  "dependencies": [
    "org.jetbrains.kotlinx:dataframe:$v"
  ],
  "integrationTypeNameRules": [
    "+:org.jetbrains.kotlinx.dataframe.**"
  ]
}

The list in the repository is very limited and not practical for Kotlin Notebook to be used in general purpose. Consequently, if my notebook need to use aws kotlin sdk and dataframe. I have two different ways to import dependencies.

Option 1: Mixed

%use dataframe

USE {
    repositories {
        mavenCentral()
    }
    dependencies {
        implementation("aws.sdk.kotlin:bedrock-jvm:1.4.11")
    }
}

Option 2: Use gradle-like syntax only

USE {
    repositories {
        mavenCentral()
    }
    dependencies {
        implementation("aws.sdk.kotlin:bedrock-jvm:1.4.11")
        implementation("org.jetbrains.kotlinx.dataframe:1.5.0")
    }
}

Using a custom alias in kotlin-jupyter-libraries introduced extra complexities.

  • More work to maintain the kotlin-jupyter-libraries repostiory
  • Handle the alias naming collision when it grows
  • More complexities for new users to kick start in their first step!! (limited library options and need to find another way USE to import)
  • Not align with the existing JVM/multiple-platform dependencies for experience users

Proposed design

Resolve libraries from Maven automatically.

%use org.jetbrains.kotlinx.dataframe aws.sdk.kotlin:bedrock-jvm

# or with version
%use org.jetbrains.kotlinx.dataframe:0.15.0 aws.sdk.kotlin:bedrock-jvm:1.4.11

As the naming pattern must have {groupId}:{artifactId}:{version}, it should be backward-compatible.

gaplo917 added a commit to gaplo917/awesome-kotlin-notebook that referenced this issue Feb 9, 2025
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

No branches or pull requests

1 participant