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

0.6.x -> main #958

Merged
merged 56 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6b77382
Remove more unused plugins
armanbilge Jul 12, 2023
41a3ac6
Merge pull request #925 from armanbilge/patch-9
mpilquist Jul 12, 2023
f271cb3
Update to sbt-typelevel 0.5.0
armanbilge Aug 10, 2023
b4fe82f
Merge pull request #937 from armanbilge/update/sbt-typelevel-0.5.0
mpilquist Aug 15, 2023
7dcb8af
Update fs2-core, fs2-io to 3.8.0 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
7a2444e
Update epollcat to 0.1.5 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
83841ff
Update enumeratum to 1.7.3 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
9b9d3ca
Update sbt-scala-native-crossproject to 1.3.2 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
1cb4514
Update sbt-scalajs to 1.13.2 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
c43941b
Update scala-library to 2.12.18 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
667e05f
Remove unused dep
armanbilge Aug 16, 2023
e54f7db
Update scala-library to 2.13.11 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
2af3d66
Update scala-collection-compat to 2.11.0 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
7078d39
Update sbt-scala-native to 0.4.14 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
90e5919
Update junit-interface, munit to 1.0.0-M8 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
f0ad30a
Update scalafmt-core to 3.7.12 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
4047661
Update sbt-scoverage to 2.0.8 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
4ca361e
Update natchez-core, natchez-honeycomb, ... to 0.3.3 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
79f2b2e
Update cats-core, cats-free, cats-laws to 2.10.0 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
de270b2
Update cats-effect to 3.5.1 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
0a28440
Update sbt-typelevel, sbt-typelevel-site to 0.5.0-RC12 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
75163c6
Merge pull request #940 from typelevel/update/series/0.6.x/fs2-core-3…
armanbilge Aug 16, 2023
09616bc
Merge pull request #941 from typelevel/update/series/0.6.x/epollcat-0…
armanbilge Aug 16, 2023
4451a5e
Pin refined to 0.10.x in series/0.6
armanbilge Aug 16, 2023
49f454c
Add trailing `.`
armanbilge Aug 16, 2023
7303a34
Merge pull request #944 from typelevel/update/series/0.6.x/sbt-scala-…
armanbilge Aug 16, 2023
82b3252
Merge pull request #942 from typelevel/update/series/0.6.x/enumeratum…
armanbilge Aug 16, 2023
9797863
Merge pull request #945 from typelevel/update/series/0.6.x/sbt-scalaj…
armanbilge Aug 16, 2023
abe8e45
Merge pull request #946 from typelevel/update/series/0.6.x/scala-libr…
armanbilge Aug 16, 2023
dac5221
Merge pull request #948 from typelevel/update/series/0.6.x/scala-coll…
armanbilge Aug 16, 2023
5e71820
Merge pull request #951 from typelevel/update/series/0.6.x/scalafmt-c…
armanbilge Aug 16, 2023
1986bbf
Merge pull request #950 from typelevel/update/series/0.6.x/junit-inte…
armanbilge Aug 16, 2023
96eedc4
Revert commit(s) e54f7db
typelevel-steward[bot] Aug 16, 2023
2a44e80
Merge branch 'series/0.6.x' into update/series/0.6.x/scala-library-2.…
typelevel-steward[bot] Aug 16, 2023
0421f79
Update scala-library to 2.13.11 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
543de16
Revert commit(s) 7078d39
typelevel-steward[bot] Aug 16, 2023
fe434c0
Merge branch 'series/0.6.x' into update/series/0.6.x/sbt-scala-native…
typelevel-steward[bot] Aug 16, 2023
baf5401
Update sbt-scala-native to 0.4.14 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
35aa7a4
Revert commit(s) 4047661
typelevel-steward[bot] Aug 16, 2023
0a7270d
Merge branch 'series/0.6.x' into update/series/0.6.x/sbt-scoverage-2.0.8
typelevel-steward[bot] Aug 16, 2023
dfa65a8
Update sbt-scoverage to 2.0.8 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
a0f6bd8
Revert commit(s) 4ca361e
typelevel-steward[bot] Aug 16, 2023
d7f1e58
Merge branch 'series/0.6.x' into update/series/0.6.x/natchez-core-0.3.3
typelevel-steward[bot] Aug 16, 2023
fcd48e1
Update natchez-core, natchez-honeycomb, ... to 0.3.3 in series/0.6.x
typelevel-steward[bot] Aug 16, 2023
4f21132
Regenerate workflow
armanbilge Aug 16, 2023
b5277cd
Fix Scala 3 compile
armanbilge Aug 14, 2023
25bb707
Merge pull request #956 from typelevel/update/series/0.6.x/sbt-typele…
armanbilge Aug 16, 2023
c135fc2
Merge pull request #955 from typelevel/update/series/0.6.x/cats-effec…
armanbilge Aug 16, 2023
f63353f
Merge pull request #952 from typelevel/update/series/0.6.x/sbt-scover…
armanbilge Aug 16, 2023
d0740ae
Merge pull request #949 from typelevel/update/series/0.6.x/sbt-scala-…
armanbilge Aug 16, 2023
d69b1b5
Merge pull request #953 from typelevel/update/series/0.6.x/natchez-co…
armanbilge Aug 16, 2023
d9594ad
Merge pull request #957 from typelevel/pr/pin-refined
armanbilge Aug 16, 2023
b735f15
Merge branch 'series/0.6.x' into update/series/0.6.x/cats-core-2.10.0
armanbilge Aug 16, 2023
29f19aa
Merge pull request #947 from typelevel/update/series/0.6.x/scala-libr…
armanbilge Aug 16, 2023
4ebff30
Merge pull request #954 from typelevel/update/series/0.6.x/cats-core-…
armanbilge Aug 16, 2023
1a583aa
Merge branch 'series/0.6.x'
armanbilge Aug 16, 2023
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
237 changes: 113 additions & 124 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "3.7.9"
version = "3.7.12"
runner.dialect = Scala213Source3
project.includePaths = [] # disables formatting
44 changes: 24 additions & 20 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ThisBuild / tlBaseVersion := "1.0"

// Our Scala versions.
lazy val `scala-2.13` = "2.13.10"
lazy val `scala-2.13` = "2.13.11"
lazy val `scala-3` = "3.3.0"

ThisBuild / scalaVersion := `scala-2.13`
Expand All @@ -14,14 +14,15 @@ ThisBuild / developers := List(
)

ThisBuild / tlCiReleaseBranches += "series/0.6.x"
ThisBuild / tlCiScalafmtCheck := false
ThisBuild / tlSitePublishBranch := Some("series/0.6.x")
ThisBuild / tlSonatypeUseLegacyHost := false
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11"))
ThisBuild / tlJdkRelease := Some(8)

ThisBuild / githubWorkflowBuildPreamble ++= nativeBrewInstallWorkflowSteps.value
ThisBuild / nativeBrewInstallCond := Some("matrix.project == 'rootNative'")
ThisBuild / nativeBrewInstallCond := Some("matrix.project == 'skunkNative'")

lazy val setupCertAndDocker = Seq(
WorkflowStep.Run(
Expand All @@ -36,15 +37,12 @@ ThisBuild / tlCiHeaderCheck := true
ThisBuild / githubWorkflowAddedJobs +=
WorkflowJob(
id = "coverage",
name = s"Generate coverage report (${`scala-2.13`} JVM only)",
name = s"Generate coverage report (2.13 JVM only)",
scalas = List(`scala-2.13`),
steps = githubWorkflowJobSetup.value.toList ++
List(
WorkflowStep.Sbt(List("coverage", "rootJVM/test", "coverageReport")),
WorkflowStep.Run(
List("bash <(curl -s https://codecov.io/bash)"),
name = Some("Upload code coverage data")
)
WorkflowStep.Sbt(List("coverage", "skunkJVM/test", "coverageReport")),
WorkflowStep.Use(UseRef.Public("codecov", "codecov-action", "v3"))
)
)

Expand All @@ -59,7 +57,7 @@ ThisBuild / mimaBinaryIssueFilters ++= List(
)

// This is used in a couple places
lazy val fs2Version = "3.7.0"
lazy val fs2Version = "3.8.0"
lazy val openTelemetryVersion = "1.28.0"
lazy val otel4sVersion = "0.2.1"

Expand All @@ -82,7 +80,7 @@ lazy val commonSettings = Seq(

// Compilation
scalacOptions -= "-language:experimental.macros", // doesn't work cross-version
Compile / doc / scalacOptions --= Seq("-Xfatal-warnings"),
Compile / doc / scalacOptions --= Seq("-Werror"),
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-sourcepath", (LocalRootProject / baseDirectory).value.getAbsolutePath,
Expand All @@ -109,10 +107,9 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.settings(
name := "skunk-core",
description := "Tagless, non-blocking data access library for Postgres.",
scalacOptions ~= (_.filterNot(_ == "-source:3.0-migration")),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % "2.9.0",
"org.typelevel" %%% "cats-effect" % "3.5.0",
"org.typelevel" %%% "cats-core" % "2.10.0",
"org.typelevel" %%% "cats-effect" % "3.5.1",
"co.fs2" %%% "fs2-core" % fs2Version,
"co.fs2" %%% "fs2-io" % fs2Version,
"org.scodec" %%% "scodec-bits" % "1.1.37",
Expand All @@ -122,7 +119,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
"org.tpolecat" %%% "sourcepos" % "1.1.0",
"org.typelevel" %%% "twiddles-core" % "0.6.0",
) ++ Seq(
"com.beachape" %%% "enumeratum" % "1.7.2",
"com.beachape" %%% "enumeratum" % "1.7.3",
).filterNot(_ => tlIsScala3.value)
).jvmSettings(
libraryDependencies += "com.ongres.scram" % "client" % "2.1",
Expand Down Expand Up @@ -168,14 +165,14 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.enablePlugins(AutomateHeaderPlugin, NoPublishPlugin)
.settings(commonSettings)
.settings(
scalacOptions -= "-Xfatal-warnings",
tlFatalWarnings := false,
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "1.0.0-M7",
"org.scalameta" % "junit-interface" % "1.0.0-M7",
"org.scalameta" %%% "munit" % "1.0.0-M8",
"org.scalameta" % "junit-interface" % "1.0.0-M8",
"org.typelevel" %%% "scalacheck-effect-munit" % "2.0.0-M2",
"org.typelevel" %%% "munit-cats-effect" % "2.0.0-M3",
"org.typelevel" %%% "cats-free" % "2.9.0",
"org.typelevel" %%% "cats-laws" % "2.9.0",
"org.typelevel" %%% "cats-free" % "2.10.0",
"org.typelevel" %%% "cats-laws" % "2.10.0",
"org.typelevel" %%% "discipline-munit" % "2.0.0-M3",
"org.typelevel" %%% "cats-time" % "0.5.1",
),
Expand Down Expand Up @@ -204,7 +201,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
)
.nativeEnablePlugins(ScalaNativeBrewedConfigPlugin)
.nativeSettings(
libraryDependencies += "com.armanbilge" %%% "epollcat" % "0.1.4",
libraryDependencies += "com.armanbilge" %%% "epollcat" % "0.1.5",
Test / nativeBrewFormulas ++= Set("s2n", "utf8proc"),
Test / envVars ++= Map("S2N_DONT_MLOCK" -> "1")
)
Expand Down Expand Up @@ -246,7 +243,14 @@ lazy val docs = project
.enablePlugins(TypelevelSitePlugin)
.settings(commonSettings)
.settings(
scalacOptions ~= {
_.map {
case opt if opt.startsWith("-Xlint") => s"$opt,-missing-interpolator"
case opt => opt
}
},
mdocIn := (Compile / sourceDirectory).value / "laika",
tlSiteIsTypelevelProject := Some(TypelevelProject.Affiliate),
laikaConfig := {
import laika.rewrite.link._

Expand Down
3 changes: 3 additions & 0 deletions modules/core/native/src/main/scala/net/message/openssl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

package skunk.net.message

import org.typelevel.scalaccompat.annotation._

import scala.scalanative.unsafe._

@nowarn212
@link("crypto")
@extern
private[message] object openssl {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ object StringContextOps {
}

def identifier_impl(): Tree = {
val Apply(_, List(Apply(_, List(Literal(Constant(part: String)))))) = c.prefix.tree
val Apply(_, List(Apply(_, List(Literal(Constant(part: String)))))) = c.prefix.tree: @unchecked
Identifier.fromString(part) match {
case Left(s) => c.abort(c.enclosingPosition, s)
case Right(Identifier(s)) => q"_root_.skunk.data.Identifier.fromString($s).fold(sys.error, identity)"
Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala-3/SqlState.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package skunk

import scala.collection.immutable.IndexedSeq
import skunk.exception.PostgresErrorException

/**
Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala-3/util/Twiddler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package skunk
package util

import scala.annotation.implicitNotFound
import scala.quoted._
import scala.deriving.Mirror

import skunk.implicits._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ trait TemporalCodecs {
.optionalStart
.appendFraction(NANO_OF_SECOND, 0, precision, true)
.optionalEnd
()
}

requiredPart.toFormatter(Locale.US)
Expand Down
4 changes: 2 additions & 2 deletions modules/core/shared/src/main/scala/data/Arr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ final class Arr[A] private (
) {

// Data and extent must be consistent. Should be guaranteed but let's check anyway.
assert((data.isEmpty && extent.isEmpty) || (data.length == extent.product))
assert((data.isEmpty && extent.isEmpty) || (data.length == wrapIntArray(extent).product))

// In order to access elements we need the offsets associated with each dimension. But let's not
// compute it unless we need to since these will be constructed in a tight loop when we unroll
// a resultset that contains array columns.
private lazy val _offsets: Array[Int] =
extent.tails.map(_.product).drop(1).toArray
extent.tails.map(wrapIntArray(_).product).drop(1).toArray

/**
* Attempt to reshape this `Arr` with the specified dimensions. This is possible if and only if
Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala/net/message/Bind.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec._
import scodec.codecs._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec.codecs._
import scodec.Encoder

Expand Down
1 change: 0 additions & 1 deletion modules/core/shared/src/main/scala/net/message/Parse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec.codecs._
import scodec.Encoder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec.Encoder
import scodec.bits.ByteVector
import scodec.codecs.{bytes, int32, variableSizeBytes}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package skunk.net.message

import cats.syntax.all._
import scodec.interop.cats._
import scodec._
import scodec.codecs._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package protocol
import cats.FlatMap
import cats.syntax.all._
import skunk.net.message.{ Close => CloseMessage, Flush, CloseComplete }
import skunk.net.MessageSocket
import org.typelevel.otel4s.Attribute
import org.typelevel.otel4s.trace.Span
import org.typelevel.otel4s.trace.Tracer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object Parse {
_ <- span.addAttributes(
Attribute("statement-name", id.value),
Attribute("statement-sql", statement.sql),
Attribute("statement-parameter-types", os.map(n => ty.typeForOid(n, -1).getOrElse(n)).mkString("[", ", ", "]"))
Attribute("statement-parameter-types", os.map(n => ty.typeForOid(n, -1).fold(n.toString)(_.toString)).mkString("[", ", ", "]"))
)
_ <- send(ParseMessage(id.value, statement.sql, os))
_ <- send(Flush)
Expand Down
6 changes: 5 additions & 1 deletion modules/core/shared/src/main/scala/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT

package skunk

import cats.effect.Resource
import org.typelevel.scalaccompat.annotation._
import org.typelevel.twiddles.TwiddleCompat

/**
Expand Down Expand Up @@ -123,7 +126,8 @@ import org.typelevel.twiddles.TwiddleCompat
* @groupname Companions Companion Objects
* @groupprio Companions 999
*/
package object skunk extends TwiddleCompat {
@nowarn213("msg=package object inheritance is deprecated")
object `package` extends TwiddleCompat { // aka package object skunk, yes this actually works ...

// we can use this to defeat value discarding warnings for erasable proof terms
private[skunk] def void(a: Any*): Unit = (a, ())._2
Expand Down
13 changes: 5 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ ThisBuild / libraryDependencySchemes ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
)

addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.21")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.21")
addSbtPlugin("com.github.sbt" % "sbt-site" % "1.5.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.5.0-RC12")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.5.0-RC12")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.7")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.12")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("com.armanbilge" % "sbt-scala-native-config-brew-github-actions" % "0.1.3")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.14")
addSbtPlugin("com.armanbilge" % "sbt-scala-native-config-brew-github-actions" % "0.2.0-RC1")