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

Add pureconfig for scala3 [fixes fthomas/refined#1092] #1162

Merged
merged 8 commits into from
Mar 13, 2023

Conversation

ivan-klass
Copy link
Contributor

Added ConfigReader and ConfigWriter for refined types

I've kept 2.13 signature as is in order to keep binary compatibility - I'll be happy if one can help checking if it is actually maintained.

Also, now refined ConfigReader and ConfigWriter can be obtained independently from ConfigConvert (more basic instances have lower priority when resolving).
I tend to think that ConfigWriter is used much more rarely in practice then ConfigReader. But with previous code it was impossible to get ConfigReader[T Refined P] if you only have ConfigReader[T] but no ConfigWriter[T]

@mergify mergify bot added the pureconfig label Mar 10, 2023
@fthomas
Copy link
Owner

fthomas commented Mar 11, 2023

Thanks for the PR, @ivan-klass!

The Scala 3 build failed with:

[error] -- [E008] Not Found Error: /home/runner/work/refined/refined/modules/pureconfig/shared/src/test/scala-3.0+/eu/timepit/refined/pureconfig/SpecDerivedInstances.scala:17:36 
[error] 17 |    ConfigValueFactory.fromMap(JMap.of("value", cfg))
[error]    |                               ^^^^^^^
[error]    |                        value of is not a member of object java.util.Map

build.sbt Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 11, 2023

Codecov Report

Merging #1162 (ae47168) into master (f3546e2) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1162      +/-   ##
==========================================
+ Coverage   92.66%   92.69%   +0.02%     
==========================================
  Files          63       65       +2     
  Lines         832      835       +3     
  Branches       26       29       +3     
==========================================
+ Hits          771      774       +3     
  Misses         61       61              
Impacted Files Coverage Δ
...fined/pureconfig/TypeDescribeVersionSpecific.scala 100.00% <100.00%> (ø)
.../eu/timepit/refined/pureconfig/BaseInstances.scala 100.00% <100.00%> (ø)
.../scala/eu/timepit/refined/pureconfig/package.scala 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ivan-klass ivan-klass changed the title Add pureconfig for scala3 Add pureconfig for scala3 (resolves #1092) Mar 11, 2023
@ivan-klass ivan-klass changed the title Add pureconfig for scala3 (resolves #1092) Add pureconfig for scala3 [resolves fthomas/refined#1092] Mar 11, 2023
@ivan-klass ivan-klass changed the title Add pureconfig for scala3 [resolves fthomas/refined#1092] Add pureconfig for scala3 [closes fthomas/refined#1092] Mar 11, 2023
@ivan-klass ivan-klass changed the title Add pureconfig for scala3 [closes fthomas/refined#1092] Add pureconfig for scala3 [fixes fthomas/refined#1092] Mar 11, 2023
@ivan-klass
Copy link
Contributor Author

Linking #1092 to this (I wonder why PR title doesn't work as described by docs

@fthomas fthomas linked an issue Mar 12, 2023 that may be closed by this pull request
@fthomas
Copy link
Owner

fthomas commented Mar 12, 2023

I've kept 2.13 signature as is in order to keep binary compatibility - I'll be happy if one can help checking if it is actually maintained.

The CI checks this with MiMa. I just checked this locally again to make sure that it is compatible:

sbt:refined> pureconfigJVM/mimaPreviousArtifacts
[info] Set(eu.timepit:refined-pureconfig:0.10.0, eu.timepit:refined-pureconfig:0.10.1, eu.timepit:refined-pureconfig:0.10.2)
sbt:refined> pureconfigJVM/mimaReportBinaryIssues
[info] compiling 45 Scala sources to refined/modules/core/jvm/target/scala-2.13/classes ...
[info] compiling 3 Scala sources to refined/modules/pureconfig/jvm/target/scala-2.13/classes ...
[success] Total time: 7 s, completed Mar 12, 2023, 9:45:50 AM

Seems to be fine.

Copy link
Owner

@fthomas fthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks again, @ivan-klass!

@fthomas fthomas merged commit b56c90e into fthomas:master Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pureconfig not published for scala3
2 participants