Skip to content

Post Java 11 version bumps #1087

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

Merged
merged 8 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/generated-sources-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'

- name: Run Gradle task
run: ./gradlew :core:processKDocsMain korro
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generated-sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'

- name: Configure Git User
run: |
Expand Down
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ so do familiarize yourself with the following guidelines.

## Environment requirements

* JDK >= 11 referred to by the `JAVA_HOME` environment variable.
* JDK >= 21 referred to by the `JAVA_HOME` environment variable.

* Note, any version above 11 should work in theory, but JDK 11 is the only version we test with,
* Note, any version above 21 should work in theory, but JDK 21 is the only version we test with,
so it is the recommended version.

* JDK == 11 referred to by the `JDK_11_0` environment variable or `gradle.properties`/`local.properties`.
* This is used for testing our compiler plugins.

* We recommend using [IntelliJ IDEA](https://www.jetbrains.com/idea/download/) as the IDE. This
has the best support for Kotlin, compiler plugins, Gradle, and [Kotlin Notebook](https://kotlinlang.org/docs/kotlin-notebook-overview.html) of course.

Expand Down
21 changes: 11 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,10 @@ fun String.findVersion(): Version {

// these names of outdated dependencies will not show up in the table output
val dependencyUpdateExclusions = listOf(
// TODO Requires more work to be updated to 1.7.0+, https://github.com/Kotlin/dataframe/issues/594
libs.plugins.kover.get().pluginId,
// TODO 5.8.0 is not possible due to https://github.com/Kotlin/dataframe/issues/595
libs.kotestAssertions.get().name,
// Can't be updated to 7.4.0+ due to Java 8 compatibility
libs.android.gradle.api.get().group,
// Directly dependent on the Gradle version
"org.gradle.kotlin.kotlin-dsl",
// Can't be updated to 2.1.0+ due to Java 8 compatibility
libs.plugins.simpleGit.get().pluginId,
// need to revise our tests to update
libs.android.gradle.api.get().group,
)

// run `./gradlew dependencyUpdates` to check for updates
Expand Down Expand Up @@ -139,18 +133,25 @@ tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
}
}

kotlin.jvmToolchain(11)
kotlin {
jvmToolchain(21)
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}

allprojects {
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
freeCompilerArgs.add("-Xjdk-release=11")
}
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
options.release.set(11)
}

// Attempts to configure ktlint for each sub-project that uses the plugin
Expand All @@ -165,7 +166,7 @@ allprojects {
}

// set the java toolchain version to 11 for all subprojects for CI stability
extensions.findByType<KotlinJvmProjectExtension>()?.jvmToolchain(11)
extensions.findByType<KotlinJvmProjectExtension>()?.jvmToolchain(21)

// Attempts to configure buildConfig for each sub-project that uses it
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ class JsonTests {
@Test
fun `serialize column with list of objects`() {
val df = dataFrameOf("col")(Regex(".+").findAll("abc").toList())
val json = shouldNotThrowAny { df.toJson() }
val json = shouldNotThrowAny { df.toJson() }!!
val list = DataFrame.readJsonStr(json)["col"][0].shouldBeInstanceOf<List<*>>()
list[0].shouldBeInstanceOf<String>()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jetbrains.kotlinx.dataframe.statistics

import io.kotest.matchers.doubles.shouldBeNaN
import io.kotest.matchers.shouldBe
import org.jetbrains.kotlinx.dataframe.DataColumn
import org.jetbrains.kotlinx.dataframe.api.columnOf
Expand All @@ -18,10 +19,10 @@ class BasicMathTests {

@Test
fun `mean with nans and nulls`() {
columnOf(10, 20, Double.NaN, null).mean() shouldBe Double.NaN
columnOf(10, 20, Double.NaN, null).mean().shouldBeNaN()
columnOf(10, 20, Double.NaN, null).mean(skipNA = true) shouldBe 15

DataColumn.createValueColumn("", emptyList<Nothing>(), nothingType(false)).mean() shouldBe Double.NaN
DataColumn.createValueColumn("", listOf(null), nothingType(true)).mean() shouldBe Double.NaN
DataColumn.createValueColumn("", emptyList<Nothing>(), nothingType(false)).mean().shouldBeNaN()
DataColumn.createValueColumn("", listOf(null), nothingType(true)).mean().shouldBeNaN()
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jetbrains.kotlinx.dataframe.statistics

import io.kotest.matchers.doubles.shouldBeNaN
import io.kotest.matchers.shouldBe
import org.jetbrains.kotlinx.dataframe.DataColumn
import org.jetbrains.kotlinx.dataframe.api.columnOf
Expand Down Expand Up @@ -59,10 +60,10 @@ class StdTests {
val empty = DataColumn.createValueColumn("", emptyList<Nothing>(), nothingType(false))
val nullable = DataColumn.createValueColumn("", listOf(null), nothingType(true))

empty.values().std(empty.type) shouldBe Double.NaN
nullable.values().std(nullable.type) shouldBe Double.NaN
empty.values().std(empty.type).shouldBeNaN()
nullable.values().std(nullable.type).shouldBeNaN()

empty.std() shouldBe Double.NaN
nullable.std() shouldBe Double.NaN
empty.std().shouldBeNaN()
nullable.std().shouldBeNaN()
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jetbrains.kotlinx.dataframe.testSets.animals

import io.kotest.matchers.doubles.shouldBeNaN
import io.kotest.matchers.shouldBe
import org.jetbrains.kotlinx.dataframe.api.columnOf
import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
Expand Down Expand Up @@ -42,7 +43,7 @@ class AnimalsTests {
.update { age }.with { Double.NaN }
.update { visits }.withNull()
val mean = cleared.mean()
mean[age] shouldBe Double.NaN
(mean[visits.name()] as Double).isNaN() shouldBe true
mean[age].shouldBeNaN()
(mean[visits.name()] as Double).shouldBeNaN()
}
}
Loading