Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 15:23
    ashabhasa starred pureconfig/pureconfig
  • Jan 30 2019 20:03

    ruippeixotog on master

    Update cats-effect, fs2 and htt… Merge pull request #448 from ba… (compare)

  • Jan 30 2019 20:03
    ruippeixotog closed #448
  • Jan 30 2019 08:05
    Mao1990 starred pureconfig/pureconfig
  • Jan 29 2019 13:08
    bardurdam opened #448
  • Jan 29 2019 10:20
    PatrykRudnicki starred pureconfig/pureconfig
  • Jan 28 2019 18:52

    ruippeixotog on master

    Create a FluentConfigCursor Merge branch 'master' into flue… Fix yaml module on Scala 2.11 and 3 more (compare)

  • Jan 28 2019 18:52
    ruippeixotog closed #443
  • Jan 28 2019 18:02
    ruippeixotog synchronize #443
  • Jan 28 2019 18:02

    ruippeixotog on fluent-cursor

    Create scalaz module for pureco… Merge branch 'master' into scal… Update module with latest Confi… and 19 more (compare)

  • Jan 27 2019 14:09
    esumitra starred pureconfig/pureconfig
  • Jan 27 2019 01:55

    ruippeixotog on master

    Create scalaz module for pureco… Merge branch 'master' into scal… Update module with latest Confi… and 6 more (compare)

  • Jan 27 2019 01:55
    ruippeixotog closed #444
  • Jan 27 2019 01:19
    ruippeixotog synchronize #444
  • Jan 27 2019 01:19

    ruippeixotog on master

    Add cron4s module - add cron4s… Merge pull request #446 from ba… (compare)

  • Jan 27 2019 01:19
    ruippeixotog closed #446
  • Jan 26 2019 22:51
    ChernikovP synchronize #444
  • Jan 26 2019 22:37
    bardurdam synchronize #446
  • Jan 26 2019 22:36
    bardurdam commented #446
  • Jan 26 2019 22:31
    bardurdam synchronize #446
peterstorm
@peterstorm:matrix.org
[m]
Hello! Is there any way to rewrite this in Scala 3?
import cats.effect.Sync
import cats.syntax.all._
import domain.configuration.AppConfig
import domain.errors.ConfigLoadError
import pureconfig.ConfigSource
import pureconfig.generic.auto._

trait Configuration[F[_]] {
    def access: F[AppConfig]
}

object Configuration {

    def apply[F[_]](implicit ev: Configuration[F]): Configuration[F] = ev

    def load[F[_]: Sync]: F[Configuration[F]] = process(ConfigSource.default)

    implicit def process[F[_]: Sync](source: ConfigSource): F[Configuration[F]] = {
        Sync[F].fromEither(source.load[AppConfig].leftMap(ConfigLoadError))
            .map { config => 
                new Configuration[F] {
                    def access: F[AppConfig] = Sync[F].delay(config)
                }
            }
    }
}
Joao Azevedo
@jcazevedo
@peterstorm:matrix.org: Not yet because we still don't support generic derivation of ConfigReader instances in Scala 3. The alternative, for now, would be to explicitly define your ConfigReader instances (using, for example, the ConfigReader.forProductN helpers).
peterstorm
@peterstorm:matrix.org
[m]
Ah ok, do you have an example of that? @j
Joao Azevedo
@jcazevedo
peterstorm
@peterstorm:matrix.org
[m]
Would this be placed in the companion object by the way?
Joao Azevedo
@jcazevedo
In order for the ConfigReader implicit it to be available in the implicit scope of the required type, yes, it makes it easier to define it in the companion object of the configuration type (in your case, the AppConfig).
If it's not in the companion object, an explicit import might be required.
heksesang
@heksenlied:matrix.org
[m]
@jcazevedoruippeixotog (Rui Gonçalves): I have updated the PR for the derives code (and added a question in the comments), it would be nice if you guys have time to look at it. :)
Joao Azevedo
@jcazevedo
@heksenlied:matrix.org: Thanks for your contributions and sorry about the waiting time. I haven't had a lot of time for PureConfig recently. I'll try to review the PR during this week.
heksesang
@heksenlied:matrix.org
[m]
Cool. I think it's pretty close to be ready for merging. It's a lot simpler now that it doesn't use any of the generic stuff, and I managed to simplify the one for products so it has more code reuse between tuple and case class derivation.
Ivan Aristov
@Ssstlis
Hi guys. A few days ago a PR with backport module for CE2 was merged. How we can release it until the next one milestone? I mean this one pureconfig/pureconfig#1041
Chris Lan
@chrislan815
Hi all!.
usually, when we use ConfigSource.load we import import pureconfig.generic.auto._. we've been using pureconfig 0.12.5 version and that import statement has always been marked as unused by intellij. Today I upgraded to 0.15 and intellij somehow knows it's being used now! I was wondering if anyone knows what the change was?
Rui Gonçalves
@ruippeixotog

Hi guys. A few days ago a PR with backport module for CE2 was merged. How we can release it until the next one milestone? I mean this one pureconfig/pureconfig#1041

I'll try to do a release this weekend.

Ivan Aristov
@Ssstlis
Hello, @ruippeixotog , any updates? =)
Rui Gonçalves
@ruippeixotog
Sorry for the delay, I'm still writing some documentation for Scala 3. It's is our first release supporting native derivation I want to make sure it's mentioned on our website
Ivan Aristov
@Ssstlis
@ruippeixotog don't you try to publish it from the local machine with 0.15.0 version?)
Rui Gonçalves
@ruippeixotog
We don't publish single new modules for existing versions - it's bad practice as there would be no guarantees in theory that the new module would be compatible with a pureconfig-core published in the past. PureConfig releases are frozen in time so you'll need to wait for v0.16.0, sorry about that.
Rui Gonçalves
@ruippeixotog
@Ssstlis I have just released v0.16.0
Ivan Aristov
@Ssstlis

@Ssstlis I have just released v0.16.0

Thanks!

Krunoslav Uzelac
@Reeebuuk
val conf: Settings = ConfigSource.fromConfig(ConfigFactory.load()).loadOrThrow[Settings]
import pureconfig.generic.auto._
could not find implicit value for parameter reader: pureconfig.ConfigReader[..Settings]
this used to work until I pulled some newest dependencies on the side
tried the semiderivation version but doesn't work as well
any ideas on how to debug it?
ofc the import is above the load function :D
scala 2.12.11 with pureconfig 0.16.0
or 0.15.0 same result
heksesang
@heksenlied:matrix.org
[m]
Easiest way to debug that I have found is to try to summon instances of ConfigReader for the various parts of Settings until you can eliminate the cases that work, and then you eventually find what it cannot summon for. Tedious, though. :p
Another alternative is also to use the magnolia implementation for derivation, I do believe that should give better errors when it fails to derive.
Eleanna Skouta
@eleansa
Where can I find examples with Java enum?
Chris Lan
@chrislan815
Messages Image(540792430).png
image.png
is there other way to avoid writing three implicit ConfigReader[UID]?
Rui Gonçalves
@ruippeixotog
Damien O'Reilly
@DamienOReilly
Hi, after upgrading from pureconfig 0.13 to 0.16., I have compilation failures due to pureconfig.Derivation no longer available. Is there any docs about this breaking change and what I should do instead?
Joao Azevedo
@jcazevedo
@DamienOReilly: It should be sufficient to simply stop using pureconfig.Derivation explicitly: https://github.com/pureconfig/pureconfig/blob/master/CHANGELOG.md#0150-apr-18-2021
Damien O'Reilly
@DamienOReilly
Ah perfect, thanks. I missed that kn the change-log.
jenwirth
@jenwirth
I am trying to migrate a project to scala 3. I was under the impression 0.16 has scala 3 support. I am unable to load com.github.pureconfig:pureconfig_3:0.16.0 and when using .cross(CrossVersion.for3Use2_13) i am unable to use import pureconfig.generic.derivation.default._
jenwirth
@jenwirth
found it, had to use pureconfig-core
Clint Combs
@ClintCombs
@jenwirth I'm attempting to cross-compile with Scala 3. I had to add the following import in order for the derives ConfigReader to work:
import pureconfig.generic.derivation.ConfigReaderDerivation.Default.derived
Did you have to do the same?
Rui Gonçalves
@ruippeixotog
You should import import pureconfig.generic.derivation.default._, as described in https://pureconfig.github.io/docs/scala-3-derivation.html
Clint Combs
@ClintCombs
Thought I'd done that - left out "default" though. :thumbsup: thx
peterstorm
@peterstorm:matrix.org
[m]
Is there a scala 3 version of pureconfig-cats-effect?
Hmm, maybe I don't need it
Joao Azevedo
@jcazevedo
Not yet, no.
peterstorm
@peterstorm:matrix.org
[m]
None of this depends on pureconfig-cats-effect does it?
package capabilities.configuration

import domain.configuration.AppConfig
import domain.errors.ConfigLoadError
import cats.effect.Sync
import cats.syntax.all._
import pureconfig.ConfigSource

trait Configuration[F[_]]:

    def access: F[AppConfig]

object Configuration:

    def apply[F[_]](using ev: Configuration[F]): Configuration[F] = ev

    def load[F[_]: Sync]: F[Configuration[F]] = process(ConfigSource.default)

    def process[F[_]: Sync](source: ConfigSource): F[Configuration[F]] =
        Sync[F].fromEither(source.load[AppConfig].leftMap(ConfigLoadError.apply)).map( config =>
            new Configuration[F]:
                def access: F[AppConfig] = Sync[F].delay(config)
        )
I'm not using loadF anywhere, I'm just wrapping stuff from core
Joao Azevedo
@jcazevedo
I don't think so, no.
jenwirth
@jenwirth
@ClintCombs yes i have import pureconfig.generic.derivation.default._ working after finding the correct pureconfig-core