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

Drop Scala 2.12 #860

Merged
merged 3 commits into from
May 7, 2023
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
32 changes: 1 addition & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
scala: [2.12.17, 2.13.10, 3.2.2]
scala: [2.13.10, 3.2.2]
java: [temurin@11]
project: [rootJS, rootJVM, rootNative]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -168,36 +168,6 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.17, rootJS)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJS

- name: Inflate target directories (2.12.17, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12.17, rootJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM

- name: Inflate target directories (2.12.17, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12.17, rootNative)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootNative

- name: Inflate target directories (2.12.17, rootNative)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.13.10, rootJS)
uses: actions/download-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![Discord](https://img.shields.io/discord/632277896739946517.svg?label=&logo=discord&logoColor=ffffff&color=404244&labelColor=6A7EC2)](https://discord.gg/CSh8u9yPMe)
[![Join the chat at https://gitter.im/skunk-pg/Lobby](https://badges.gitter.im/skunk-pg/Lobby.svg)](https://gitter.im/skunk-pg/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![codecov](https://codecov.io/gh/tpolecat/skunk/branch/master/graph/badge.svg)](https://codecov.io/gh/tpolecat/skunk)
[![Maven Central](https://img.shields.io/maven-central/v/org.tpolecat/skunk-core_2.12.svg)](https://maven-badges.herokuapp.com/maven-central/org.tpolecat/skunk-core_2.12)
[![Javadocs](https://javadoc.io/badge/org.tpolecat/skunk-core_2.12.svg)](https://javadoc.io/doc/org.tpolecat/skunk-core_2.12)
[![Maven Central](https://img.shields.io/maven-central/v/org.tpolecat/skunk-core_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/org.tpolecat/skunk-core_2.13)
[![Javadocs](https://javadoc.io/badge/org.tpolecat/skunk-core_2.13.svg)](https://javadoc.io/doc/org.tpolecat/skunk-core_2.13)

Skunk is a data access library for Scala + Postgres.

Expand Down
13 changes: 5 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
ThisBuild / tlBaseVersion := "0.5"
ThisBuild / tlBaseVersion := "1.0"

// Our Scala versions.
lazy val `scala-2.12` = "2.12.17"
lazy val `scala-2.13` = "2.13.10"
lazy val `scala-3.0` = "3.2.2"
lazy val `scala-3` = "3.2.2"

ThisBuild / scalaVersion := `scala-2.13`
ThisBuild / crossScalaVersions :=
Seq(`scala-2.12`, `scala-2.13`, `scala-3.0`)
ThisBuild / crossScalaVersions := Seq(`scala-2.13`, `scala-3`)

ThisBuild / organization := "org.tpolecat"
ThisBuild / licenses := Seq(License.MIT)
Expand Down Expand Up @@ -134,7 +132,6 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
"org.scodec" %%% "scodec-cats" % "1.2.0",
"org.tpolecat" %%% "natchez-core" % natchezVersion,
"org.tpolecat" %%% "sourcepos" % "1.1.0",
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.10.0",
"org.typelevel" %%% "twiddles-core" % "0.6.0",
) ++ Seq(
"com.beachape" %%% "enumeratum" % "1.7.2",
Expand Down Expand Up @@ -252,8 +249,8 @@ lazy val docs = project
"core-dep" -> s"${(core.jvm / name).value}_2.${CrossVersion.partialVersion(scalaVersion.value).get._2}",
"circe-dep" -> s"${(circe.jvm / name).value}_2.${CrossVersion.partialVersion(scalaVersion.value).get._2}",
"version" -> version.value,
"scaladoc.skunk.base_url" -> s"https://static.javadoc.io/org.tpolecat/skunk-core_2.12/${version.value}",
"scaladoc.fs2.io.base_url"-> s"https://static.javadoc.io/co.fs2/fs2-io_2.12/${fs2Version}",
"scaladoc.skunk.base_url" -> s"https://static.javadoc.io/org.tpolecat/skunk-core_2.13/${version.value}",
"scaladoc.fs2.io.base_url"-> s"https://static.javadoc.io/co.fs2/fs2-io_2.13/${fs2Version}",
),
mdocIn := (baseDirectory.value) / "src" / "main" / "paradox",
Compile / paradox / sourceDirectory := mdocOut.value,
Expand Down
22 changes: 0 additions & 22 deletions modules/core/shared/src/main/scala-2.12/data/ArrPlatform.scala

This file was deleted.

15 changes: 0 additions & 15 deletions modules/core/shared/src/main/scala-2.12/utll/package.scala

This file was deleted.

22 changes: 0 additions & 22 deletions modules/core/shared/src/main/scala-2.13+/data/ArrPlatform.scala

This file was deleted.

13 changes: 0 additions & 13 deletions modules/core/shared/src/main/scala-2.13/utll/package.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package codec
import enumeratum.{ Enum, EnumEntry }
import skunk.data.Type

trait EnumCodecPlatform {
private[codec] trait EnumCodecCompat {

def `enum`[A <: EnumEntry](`enum`: Enum[A], tpe: Type): Codec[A] =
Codec.simple[A](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
package skunk
package codec

trait EnumCodecPlatform
private[codec] trait EnumCodecCompat
2 changes: 1 addition & 1 deletion modules/core/shared/src/main/scala/codec/EnumCodec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package codec

import skunk.data.Type

trait EnumCodec extends EnumCodecPlatform {
trait EnumCodec extends EnumCodecCompat {

def `enum`[A](encode: A => String, decode: String => Option[A], tpe: Type): Codec[A] =
Codec.simple[A](encode, s => decode(s).toRight(s"${tpe.name}: no such element '$s'"), tpe)
Expand Down
10 changes: 9 additions & 1 deletion modules/core/shared/src/main/scala/data/Arr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package skunk.data

import cats._
import cats.syntax.all._
import scala.collection.Factory
import scala.collection.mutable.ArrayBuffer

/**
Expand All @@ -16,7 +17,7 @@ import scala.collection.mutable.ArrayBuffer
final class Arr[A] private (
protected val data: ArrayBuffer[A],
private val extent: Array[Int]
) extends ArrPlatform[A] {
) {

// Data and extent must be consistent. Should be guaranteed but let's check anyway.
assert((data.isEmpty && extent.isEmpty) || (data.length == extent.product))
Expand Down Expand Up @@ -60,6 +61,13 @@ final class Arr[A] private (
def dimensions: List[Int] =
extent.toList

/**
* Construct this `Arr`'s elements as a collection `C`, as if first reshaped to be
* single-dimensional.
*/
def flattenTo[C](fact: Factory[A, C]): C =
data.to(fact)

/**
* Retrieve the element at the specified location, if the ordinates are in range (i.e., between
* zero and the corresponding entry in `dimensions`).
Expand Down