davenverse/cats-scalacheck

Use the scalacheck version compatible with cats-laws

nigredo-tori opened this issue · 5 comments

This library depends on scalacheck 1.14.0. However the latest cats-laws uses scalacheck 1.13.5. Since the two scalacheck versions are not binary compatible, there is no safe way to use cats-laws and cats-scalacheck together.

The easiest solution is probably to revert to scalacheck 1.13.5.

Another solution is to push for scalacheck upgrade in Discipline and Cats. I've started this issue for now: typelevel/discipline#52

I am uncertain the best way to resolve this. I truly doubt I can release this in a binary compatible way. I may be able to release a branch version that could offer the compat for the time being.

A bit tricky to solve here.

I truly doubt I can release this in a binary compatible way.

As a temporary measure you can limit the implementation to the methods that are present both in 1.13.5 and in 1.14.0. I've made a temporary Monad[Gen] in my project for now, and the only issue seems to be tailRecM. That was added in 1.14.0, but it is implemented in terms of the existing primitives, so I just copied the implementation from scalacheck. I don't think there should be any large issues with the other instances. And, of course, we will remove this cruft once everyone is on 1.14.0.

On the other hand, it's probably okay to put a pin in this for now. Specs2 already supports scalacheck (both in 4.x and in the last 3.x). There's not a lot of action in the scalatest repository right now, but there is a PR that seems to be on track to be merged this week. After that we would only need to update the dependencies in discipline (which shouldn't be a problem), and update the dependency in cats (which might be the longest part).

There's a lot of steps here, so it will take some time, but I'm optimistic that we can get the new scalacheck version in cats-laws at some point. The workaround available for now (custom instances instead of this library) is not ideal, but it's not a blocker by any measure.

Hi! I'm also affected by this problem. Could we have the variant/branch build? Or just the downgrade + not relying on the new methods?

This has been an issue for 9 months already, and according to typelevel/cats#2719 scalacheck bump is scheduled for 2.0.0, due in March. Not a sign of it so far, and in my case that means waiting till cats, cats-mtl and cats-effect all release new versions.

Also, from what I've seen, cats-* seem to be using 1.14 for scala 2.13+ - but this is too months ahead from us...

Let me know if and how I can help make this happen :)

AFAICT, Cats test infrastructure has switched to scalacheck 1.14, so everything should work OK. I'm closing this for now, but will reopen if I find any incompatibilities after updating my projects.