Skip to content

Commit

Permalink
version bumping: compress, ksp, kotlin, kotlin-jupyter, dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolanrensen committed Feb 20, 2024
1 parent 2ac873f commit 0f49f72
Show file tree
Hide file tree
Showing 22 changed files with 171 additions and 60 deletions.
9 changes: 7 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ plugins {
alias(kotlin.jvm)
alias(publisher)
alias(serialization)
alias(dataframe) apply false
alias(jupyter.api) apply false
alias(dokka)
alias(kover)
alias(kotlinter)
alias(docProcessor) apply false
alias(simpleGit) apply false
alias(dependencyVersions)

// dependence on our own plugin
alias(dataframe) apply false
alias(ksp) apply false
}
}

Expand Down Expand Up @@ -69,6 +72,8 @@ val dependencyUpdateExclusions = listOf(
libs.klaxon.get().name, // 5.6 requires Java 11
libs.plugins.kover.get().pluginId, // Requires more work to be updated to 1.7.0+
libs.plugins.kotlinter.get().pluginId, // Updating requires major changes all across the project
libs.kotestAssertions.get().name, // 5.8.0 is not possible due to https://github.com/Kotlin/kotlin-jupyter/issues/452
libs.android.gradle.api.get().group, // Can't be updated to 7.4.0+ due to Java 8 compatibility
)

// run `./gradlew dependencyUpdates` to check for updates
Expand All @@ -93,7 +98,7 @@ tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
cols("group", "name", "version") and {
"available"["milestone"] named "newVersion"
}
}.filter { "name"() !in dependencyUpdateExclusions }
}.filter { "name"() !in dependencyUpdateExclusions && "group"() !in dependencyUpdateExclusions }
logger.warn("Outdated dependencies found:")
df.print(
rowsLimit = Int.MAX_VALUE,
Expand Down
10 changes: 8 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ plugins {
alias(keywordGenerator)
alias(kover)
alias(kotlinter)
alias(dataframe)
alias(docProcessor)
alias(simpleGit)

// dependence on our own plugin
alias(dataframe)

// only mandatory if `kotlin.dataframe.add.ksp=false` in gradle.properties
alias(ksp)
}
idea
}
Expand Down Expand Up @@ -220,7 +225,8 @@ idea {
// Modify all Jar tasks such that before running the Kotlin sources are set to
// the target of processKdocMain and they are returned back to normal afterwards.
tasks.withType<Jar> {
dependsOn(processKDocsMain)
// dependsOn(processKDocsMain)
mustRunAfter(tasks.generateKeywordsSrc)
outputs.upToDateWhen { false }

doFirst {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.jetbrains.kotlinx.dataframe.api.filter
import org.jetbrains.kotlinx.dataframe.api.map
import org.jetbrains.kotlinx.dataframe.api.schema
import org.jetbrains.kotlinx.dataframe.api.take
import org.jetbrains.kotlinx.dataframe.api.type
import org.jetbrains.kotlinx.dataframe.columns.BaseColumn
import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
import org.jetbrains.kotlinx.dataframe.columns.ColumnKind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CodeGenerationTests : DataFrameJupyterTest() {

private fun Code.checkCompilation() {
lines().forEach {
exec(it)
execRendered(it)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `codegen adding column with generic type function`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
fun <T> AnyFrame.addValue(value: T) = add("value") { listOf(value) }
val df = dataFrameOf("a")(1).addValue(2)
Expand All @@ -36,7 +36,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `Don't inherit from data class`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
@DataSchema
data class A(val a: Int)
Expand All @@ -57,7 +57,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `Don't inherit from non open class`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
@DataSchema
class A(val a: Int)
Expand All @@ -78,7 +78,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `Don't inherit from open class`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
@DataSchema
open class A(val a: Int)
Expand All @@ -99,7 +99,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `Do inherit from open interface`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
@DataSchema
interface A { val a: Int }
Expand All @@ -120,7 +120,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `codegen for enumerated frames`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
val names = (0..2).map { it.toString() }
val df = dataFrameOf(names)(1, 2, 3)
Expand All @@ -136,7 +136,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `codegen for complex column names`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
val df = DataFrame.readDelimStr("[a], (b), {c}\n1, 2, 3")
df
Expand All @@ -145,7 +145,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
res1.shouldBeInstanceOf<MimeTypedResult>()

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"""listOf(df.`{a}`[0], df.`(b)`[0], df.`{c}`[0])"""
)
res2 shouldBe listOf(1, 2, 3)
Expand All @@ -154,7 +154,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `codegen for '$' that is interpolator in kotlin string literals`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
val df = DataFrame.readDelimStr("\${'$'}id\n1")
df
Expand All @@ -163,7 +163,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
res1.shouldBeInstanceOf<MimeTypedResult>()

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"listOf(df.`\$id`[0])"
)
res2 shouldBe listOf(1)
Expand All @@ -172,7 +172,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `codegen for backtick that is forbidden in kotlin identifiers`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
val df = DataFrame.readDelimStr("Day`s\n1")
df
Expand All @@ -182,7 +182,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
println(res1.entries.joinToString())

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"listOf(df.`Day's`[0])"
)
res2 shouldBe listOf(1)
Expand All @@ -193,7 +193,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
val forbiddenChar = ";"

@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
val df = DataFrame.readDelimStr("Test$forbiddenChar\n1")
df
Expand All @@ -203,7 +203,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
println(res1.entries.joinToString())

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"listOf(df.`Test `[0])"
)
res2 shouldBe listOf(1)
Expand All @@ -214,7 +214,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
val forbiddenChar = "\\\\"

@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
val df = DataFrame.readDelimStr("Test$forbiddenChar\n1")
df
Expand All @@ -224,7 +224,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
println(res1.entries.joinToString())

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"listOf(df.`Test `[0])"
)
res2 shouldBe listOf(1)
Expand All @@ -233,7 +233,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `generic interface`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
@DataSchema
interface Generic<T> {
Expand All @@ -244,7 +244,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
res1.shouldBeInstanceOf<Unit>()

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"""
val <T> ColumnsContainer<Generic<T>>.test1: DataColumn<T> get() = field
val <T> DataRow<Generic<T>>.test2: T get() = field
Expand All @@ -256,7 +256,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `generic interface with upper bound`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
@DataSchema
interface Generic <T : String> {
Expand All @@ -267,7 +267,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
res1.shouldBeInstanceOf<Unit>()

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"""
val <T : String> ColumnsContainer<Generic<T>>.test1: DataColumn<T> get() = field
val <T : String> DataRow<Generic<T>>.test2: T get() = field
Expand All @@ -279,7 +279,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `generic interface with variance and user type in type parameters`() {
@Language("kts")
val res1 = exec(
val res1 = execRendered(
"""
interface UpperBound
Expand All @@ -292,7 +292,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
res1.shouldBeInstanceOf<Unit>()

@Language("kts")
val res2 = exec(
val res2 = execRendered(
"""
val <T : UpperBound> ColumnsContainer<Generic<T>>.test1: DataColumn<T> get() = field
val <T : UpperBound> DataRow<Generic<T>>.test2: T get() = field
Expand All @@ -304,7 +304,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
@Test
fun `generate a new marker when dataframe marker is not a data schema so that columns are accessible with extensions`() {
@Language("kts")
val a = exec(
val a = execRendered(
"""
enum class State {
Idle, Productive, Maintenance
Expand All @@ -328,7 +328,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
)
shouldNotThrowAny {
@Language("kts")
val b = exec(
val b = execRendered(
"""
events.toolId
events.state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RenderingTests : JupyterReplTestCase() {
html shouldContain "Bill"

@Language("kts")
val useRes = exec(
val useRes = execRendered(
"""
USE {
render<Int> { (it * 2).toString() }
Expand Down Expand Up @@ -73,7 +73,7 @@ class RenderingTests : JupyterReplTestCase() {
fun execSimpleDf() = execHtml("""dataFrameOf("a", "b")(1, 2, 3, 4)""")

val htmlLight = execSimpleDf()
val r1 = exec("notebook.changeColorScheme(ColorScheme.DARK); 1")
val r1 = execRendered("notebook.changeColorScheme(ColorScheme.DARK); 1")
val htmlDark = execSimpleDf()

r1 shouldBe 1
Expand Down Expand Up @@ -106,7 +106,7 @@ class RenderingTests : JupyterReplTestCase() {
* @return the parsed DataFrame result as a `JsonObject`
*/
private fun executeScriptAndParseDataframeResult(@Language("kts") script: String): JsonObject {
val result = exec<MimeTypedResult>(script)
val result = execRendered<MimeTypedResult>(script)
return parseDataframeJson(result)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SampleNotebooksTests : DataFrameJupyterTest() {
val codeToExecute = replacer.replace(code)

println("Executing code:\n$codeToExecute")
val cellResult = exec(codeToExecute)
val cellResult = execRendered(codeToExecute)
println(cellResult)
}
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.jetbrains.kotlinx.dataframe.api.group
import org.jetbrains.kotlinx.dataframe.api.into
import org.jetbrains.kotlinx.dataframe.api.parse
import org.jetbrains.kotlinx.dataframe.io.toStandaloneHTML
import org.jetbrains.kotlinx.jupyter.findNthSubstring
import org.jetbrains.kotlinx.jupyter.util.findNthSubstring
import org.junit.Ignore
import org.junit.Test
import java.awt.Desktop
Expand Down
2 changes: 1 addition & 1 deletion dataframe-openapi/src/test/kotlin/OpenApiTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OpenApiTests : JupyterReplTestCase() {
private val additionalImports = openApi.createDefaultReadMethod().additionalImports.joinToString("\n")

private fun execGeneratedCode(code: Code): Code {
@Language("kts") val res1 = exec(
@Language("kts") val res1 = execRendered(
"""
$additionalImports
$code
Expand Down
4 changes: 4 additions & 0 deletions examples/idea-examples/json/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import org.jetbrains.kotlinx.dataframe.api.JsonPath
plugins {
application
kotlin("jvm")

id("org.jetbrains.kotlinx.dataframe")

// only mandatory if `kotlin.dataframe.add.ksp=false` in gradle.properties
id("com.google.devtools.ksp")
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.jetbrains.kotlinx.dataframe.annotations.ImportDataSchema
import org.jetbrains.kotlinx.dataframe.api.any
import org.jetbrains.kotlinx.dataframe.api.filter
import org.jetbrains.kotlinx.dataframe.api.print
import org.jetbrains.kotlinx.dataframe.api.value

/**
* In this file we'll demonstrate how to use OpenApi schemas
Expand All @@ -35,7 +36,7 @@ private fun gradle() {

apis.filter {
value.versions.value.any {
(updated ?: added).year >= 2021
(it.updated ?: it.added).year >= 2021
}
}

Expand Down
4 changes: 4 additions & 0 deletions examples/idea-examples/movies/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
application
kotlin("jvm")

id("org.jetbrains.kotlinx.dataframe")

// only mandatory if `kotlin.dataframe.add.ksp=false` in gradle.properties
id("com.google.devtools.ksp")
}

repositories {
Expand Down
Loading

0 comments on commit 0f49f72

Please sign in to comment.