Skip to content

Commit

Permalink
Merge pull request #190 from SwissDataScienceCenter/update/scala3-lib…
Browse files Browse the repository at this point in the history
…rary-3.5.0

chore: Update scala3-library from 3.4.3 to 3.5.0
  • Loading branch information
mergify[bot] authored Aug 28, 2024
2 parents 17acb63 + 9c5bdaa commit c2445d3
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 22 deletions.
25 changes: 15 additions & 10 deletions modules/json/src/main/scala/io/renku/json/EncoderSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,21 @@ object EncoderSupport {
final inline def membersEncoder[T](using
m: Mirror.ProductOf[T]
): Encoder[T] =
new Encoder[T] {
def write(w: Writer, value: T): Writer =
val encoders = summonEncoder[m.MirroredElemTypes]
val names = LabelsMacro.findLabels[T].toList
val values = value.asInstanceOf[Product].productIterator.toList
names.zip(values).zip(encoders).foreach { case ((k, v), e) =>
w.writeMapMember(k, v)(using Encoder[String], e.asInstanceOf[Encoder[Any]])
}
w
}
val encoders = summonEncoder[m.MirroredElemTypes]
val names = LabelsMacro.findLabels[T].toList
new MemberEncoderImpl[T](names, encoders)

final private class MemberEncoderImpl[T](
names: List[String],
encoders: List[Encoder[?]]
) extends Encoder[T] {
def write(w: Writer, value: T): Writer =
val values = value.asInstanceOf[Product].productIterator.toList
names.zip(values).zip(encoders).foreach { case ((k, v), e) =>
w.writeMapMember(k, v)(using Encoder[String], e.asInstanceOf[Encoder[Any]])
}
w
}

final inline def createEncoder[K: Encoder, V: Encoder, T](
additionalFields: AdditionalFields[T, V]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private object LabelsMacro:
private def findLabelsImpl[T: Type](using q: Quotes): Expr[Seq[String]] = {
import q.reflect.*

val keyAnno = TypeRepr.of[io.bullet.borer.derivation.key]
val keyAnno = TypeRepr.of[key]

def keyAnnotation(s: Symbol): Expr[Option[String]] = {
val key = s.annotations.find(_.tpe <:< keyAnno).map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import fs2.concurrent.SignallingRef
import dev.profunktor.redis4cats.connection.RedisClient
import dev.profunktor.redis4cats.streams.data.XAddMessage
import dev.profunktor.redis4cats.streams.{RedisStream, Streaming}
import io.renku.redis.client.RedisClientGenerators.*
import io.renku.redis.client.util.RedisBaseSuite
import io.renku.search.GeneratorSyntax.*
import munit.CatsEffectSuite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package io.renku.redis.client.util
import cats.effect.*

import dev.profunktor.redis4cats.Redis
import dev.profunktor.redis4cats.RedisCommands
import dev.profunktor.redis4cats.connection.RedisClient
import dev.profunktor.redis4cats.data.RedisCodec
import dev.profunktor.redis4cats.effect.Log as RedisLog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package io.renku.search.provision.events

import cats.syntax.all.*

import io.renku.events.v1.UserUpdated
import io.renku.events.{v1, v2}
import io.renku.search.events.syntax.*
import io.renku.search.solr.documents.User as UserDocument
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import io.renku.search.events.EventMessage
import io.renku.search.model.{EntityType, Id, Namespace}
import io.renku.search.provision.handler.FetchFromSolr.*
import io.renku.search.solr.client.SearchSolrClient
import io.renku.search.solr.documents.DocumentKind
import io.renku.search.solr.documents.{
Group as GroupDocument,
Project as ProjectDocument,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package io.renku.search.provision.metrics

import io.renku.search.model.EntityType
import io.renku.search.model.EntityType.*

object SolrMetrics:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import io.renku.search.provision.ProvisioningSuite
import io.renku.search.solr.client.SearchSolrClient
import io.renku.search.solr.client.SolrDocumentGenerators
import io.renku.search.solr.client.SolrDocumentGenerators.*
import io.renku.search.solr.documents.DocumentKind
import io.renku.search.solr.documents.{
Group as GroupDocument,
Project as ProjectDocument,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import io.renku.search.model.ModelGenerators
import io.renku.search.provision.project.AuthorizationRemovedProvisioningSpec.testCases
import io.renku.search.solr.client.SearchSolrClient
import io.renku.search.solr.client.SolrDocumentGenerators
import io.renku.search.solr.documents.PartialEntityDocument
import io.renku.search.solr.documents.{Project as ProjectDocument, *}
import io.renku.solr.client.DocVersion
import org.scalacheck.Gen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import cats.effect.IO
import cats.syntax.all.*

import io.renku.events.EventsGenerators
import io.renku.events.EventsGenerators.*
import io.renku.search.GeneratorSyntax.*
import io.renku.search.events.*
import io.renku.search.model.Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import cats.data.NonEmptyList
import cats.effect.IO

import io.renku.events.EventsGenerators
import io.renku.events.EventsGenerators.*
import io.renku.search.GeneratorSyntax.*
import io.renku.search.events.*
import io.renku.search.model.{EntityType, Id, ModelGenerators}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import io.bullet.borer.{Decoder, Encoder}
import io.renku.search.http.{ClientBuilder, ResponseLogging, RetryConfig}
import io.renku.solr.client.schema.SchemaCommand
import org.http4s.ember.client.EmberClientBuilder
import org.http4s.ember.client.EmberClientBuilder.default

trait SolrClient[F[_]]:
def config: SolrConfig
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object Dependencies {
val http4sPrometheusMetrics = "0.24.6"
val redis4Cats = "1.7.1"
val sbtMdoc = "2.5.2"
val scala = "3.4.3"
val scala = "3.5.0"
val scalacheckEffectMunit = "2.0.0-M2"
val scodec = "2.2.2"
val scodecBits = "1.2.1"
Expand Down

0 comments on commit c2445d3

Please sign in to comment.