Cats: Scalacheck is polluting end distributable

Created on 10 Jul 2016  Β·  8Comments  Β·  Source: typelevel/cats

I've noticed cats-kernel, cats-kernel-laws and cats-laws import scalacheck (possibly to use discipline?) which then inadvertently leaks upstream as it's not in test scope. Shouldn't it be set as test scope? (this got leaked into the scalajs distro as well which prompted me about it as I think it generates (I think) around 1.3MB of code) I've raised this against discipline as well.

[info]     | | +-org.typelevel:cats-kernel_2.11:0.6.0 [S]
[info]     | | +-org.typelevel:discipline_2.11:0.4 [S]
[info]     | |   +-org.scalacheck:scalacheck_2.11:1.12.4 (evicted by: 1.12.5)
[info]     | |   +-org.scalacheck:scalacheck_2.11:1.12.5 [S]
β€”β€”β€”β€”β€”β€”β€”β€”β€”
[info]     | +-org.typelevel:cats-kernel-laws_2.11:0.6.0 [S]
[info]     | | +-org.scalacheck:scalacheck_2.11:1.12.5 [S]
β€”β€”β€”β€”β€”
[info]     +-org.typelevel:cats-laws_2.11:0.6.0 [S]
[info]     | +-com.github.mpilquist:simulacrum_2.11:0.7.0 [S]
[info]     | | +-org.typelevel:macro-compat_2.11:1.1.0 [S]
[info]     | |
[info]     | +-org.scalacheck:scalacheck_2.11:1.12.5 [S]
[info]     | | +-org.scala-sbt:test-interface:1.0

Most helpful comment

@benhutchison Maybe we should open a new issue to propose getting rid of the cats artifact altogether? The only real role it plays is bundling core, free, and the laws / tests packages, and it's just as easy to explain how and when users need each of those individual pieces.

All 8 comments

The cats-kernel artifacts definitely shouldn't have ScalaCheck dependencies, and from a glance at the _sjs0.6_2.11 pom it doesn't look like they do.

The Discipline dependencies seem totally reasonable to meβ€”it's a testing library, and relies on ScalaCheck for some of its core functionality. Why do you need a non-test dependency on Discipline?

I'll inspect the dependency tree in depth when I'm home, it's either from algebra or cats, but it's something that pulls in 1.3 MB of is code where there's probably no need.
https://github.com/schrepfler/crdt-kit/blob/master/build.sbt

The README is directing people to this dependency which is depending on cats test infrastructure, eg cats-laws.

cats-core seems to be the dependency most people would want I think.

I wonder, whats the intended use for the cats dependency, as opposed to cats-core?

I raised a similar issue for alleycats recently.

In my view the cats dependency is more trouble than it's worthβ€”I think the idea is that it's only intended for pedagogical use.

After removing cats it looks much better now, sorry for the false alert. No idea why I chose cats vs cats-core!

IMO we shouldn't close this just yet, to me its not a false alert.

The badge on the front page is still telling people to use a cats dependency, which should be cats-core I think.

And ideally an explanation of what cats dependency is intended for, perhaps here.

@benhutchison Maybe we should open a new issue to propose getting rid of the cats artifact altogether? The only real role it plays is bundling core, free, and the laws / tests packages, and it's just as easy to explain how and when users need each of those individual pieces.

I'm also in favor of directing people toward the cats-core dependency. I think that there's a natural progression of people starting with that and potentially later adding free or laws as needed for their use-case. I think that @non liked the idea of recommending the "batteries included" version and letting people trim off pieces once they were ready for production usage. I can see some benefit in this approach, but since cats-core is still ready to use out of the box, I do agree with @travisbrown that it might cause more trouble than good in this case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chuwy picture chuwy  Β·  4Comments

alexandru picture alexandru  Β·  4Comments

SimY4 picture SimY4  Β·  4Comments

peterneyens picture peterneyens  Β·  5Comments

fosskers picture fosskers  Β·  3Comments