Skip to content

Community build: add cats and update cats-effect #10639

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

Merged
merged 9 commits into from
Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,24 @@
[submodule "community-build/community-projects/verify"]
path = community-build/community-projects/verify
url = https://github.com/dotty-staging/nanotest-strawman.git
[submodule "community-build/community-projects/discipline"]
path = community-build/community-projects/discipline
url = https://github.com/dotty-staging/discipline.git
[submodule "community-build/community-projects/discipline-munit"]
path = community-build/community-projects/discipline-munit
url = https://github.com/dotty-staging/discipline-munit.git
[submodule "community-build/community-projects/discipline-specs2"]
path = community-build/community-projects/discipline-specs2
url = https://github.com/dotty-staging/discipline-specs2.git
[submodule "community-build/community-projects/simulacrum-scalafix"]
path = community-build/community-projects/simulacrum-scalafix
url = https://github.com/dotty-staging/simulacrum-scalafix.git
[submodule "community-build/community-projects/cats"]
path = community-build/community-projects/cats
url = https://github.com/dotty-staging/cats.git
[submodule "community-build/community-projects/cats-mtl"]
path = community-build/community-projects/cats-mtl
url = https://github.com/dotty-staging/cats-mtl.git
[submodule "community-build/community-projects/coop"]
path = community-build/community-projects/coop
url = https://github.com/dotty-staging/coop.git
1 change: 1 addition & 0 deletions community-build/community-projects/cats
Submodule cats added at 2c27eb
2 changes: 1 addition & 1 deletion community-build/community-projects/cats-effect-2
Submodule cats-effect-2 updated 62 files
+15 −42 .github/workflows/ci.yml
+1 −1 .github/workflows/clean.yml
+2 −0 .gitignore
+7 −7 README.md
+1 −1 benchmarks/run-benchmark
+6 −3 benchmarks/shared/src/main/scala/cats/effect/benchmarks/AsyncBenchmark.scala
+1 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/AttemptBenchmark.scala
+1 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/DeepBindBenchmark.scala
+16 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/ECBenchmark.scala
+1 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/HandleErrorBenchmark.scala
+1 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/MapCallsBenchmark.scala
+1 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/MapStreamBenchmark.scala
+78 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/RefBenchmark.scala
+1 −0 benchmarks/shared/src/main/scala/cats/effect/benchmarks/ShallowBindBenchmark.scala
+30 −33 build.sbt
+4 −2 core/js/src/main/scala/cats/effect/internals/IOAppPlatform.scala
+1 −1 core/jvm/src/main/scala/cats/effect/internals/IOAppCompanionPlatform.scala
+9 −1 core/jvm/src/main/scala/cats/effect/internals/IOAppPlatform.scala
+71 −0 core/jvm/src/main/scala/cats/effect/internals/NonDaemonThreadLogger.scala
+1 −1 core/jvm/src/main/scala/cats/effect/internals/ResourcePlatform.scala
+120 −0 core/shared/src/main/scala-2.12/cats/effect/ResourceLike.scala
+0 −765 core/shared/src/main/scala-2.13+/cats/effect/Resource.scala
+120 −0 core/shared/src/main/scala-2.13+/cats/effect/ResourceLike.scala
+6 −6 core/shared/src/main/scala/cats/effect/Bracket.scala
+1 −1 core/shared/src/main/scala/cats/effect/Concurrent.scala
+1 −1 core/shared/src/main/scala/cats/effect/IO.scala
+20 −1 core/shared/src/main/scala/cats/effect/IOApp.scala
+108 −129 core/shared/src/main/scala/cats/effect/Resource.scala
+1 −1 core/shared/src/main/scala/cats/effect/Sync.scala
+30 −2 core/shared/src/main/scala/cats/effect/concurrent/Ref.scala
+5 −2 core/shared/src/main/scala/cats/effect/internals/IORunLoop.scala
+6 −0 core/shared/src/main/scala/cats/effect/package.scala
+3 −5 core/shared/src/test/scala/cats/effect/AsyncTests.scala
+3 −0 core/shared/src/test/scala/cats/effect/CatsEffectSuite.scala
+5 −7 core/shared/src/test/scala/cats/effect/ConcurrentTests.scala
+1 −3 core/shared/src/test/scala/cats/effect/IOAppTests.scala
+1 −1 core/shared/src/test/scala/cats/effect/SyntaxTests.scala
+24 −32 core/shared/src/test/scala/cats/effect/concurrent/DeferredTests.scala
+40 −122 core/shared/src/test/scala/cats/effect/concurrent/LensRefTests.scala
+132 −224 core/shared/src/test/scala/cats/effect/concurrent/MVarTests.scala
+49 −84 core/shared/src/test/scala/cats/effect/concurrent/RefTests.scala
+93 −133 core/shared/src/test/scala/cats/effect/concurrent/SemaphoreTests.scala
+1 −3 laws/js/src/test/scala/cats/effect/IOJSTests.scala
+2 −2 laws/shared/src/main/scala/cats/effect/laws/util/TestInstances.scala
+9 −12 laws/shared/src/test/scala/cats/effect/ConcurrentContinualTests.scala
+36 −346 laws/shared/src/test/scala/cats/effect/TimerTests.scala
+1 −1 project/build.properties
+4 −4 project/plugins.sbt
+8 −3 site/src/main/mdoc/concurrency/basics.md
+1 −1 site/src/main/mdoc/concurrency/deferred.md
+1 −1 site/src/main/mdoc/concurrency/ref.md
+1 −1 site/src/main/mdoc/concurrency/semaphore.md
+1 −1 site/src/main/mdoc/datatypes/clock.md
+1 −1 site/src/main/mdoc/datatypes/contextshift.md
+9 −10 site/src/main/mdoc/datatypes/io.md
+2 −2 site/src/main/mdoc/datatypes/resource.md
+93 −0 site/src/main/mdoc/testing/index.md
+1 −1 site/src/main/mdoc/tracing/index.md
+517 −761 site/src/main/mdoc/tutorial/tutorial.md
+0 −1 site/src/main/mdoc/typeclasses/liftio.md
+2 −2 site/src/main/mdoc/typeclasses/sync.md
+4 −0 site/src/main/resources/microsite/data/menu.yml
2 changes: 1 addition & 1 deletion community-build/community-projects/cats-effect-3
Submodule cats-effect-3 updated 200 files
1 change: 1 addition & 0 deletions community-build/community-projects/cats-mtl
Submodule cats-mtl added at 5b5dd2
1 change: 1 addition & 0 deletions community-build/community-projects/coop
Submodule coop added at d3bcd3
1 change: 1 addition & 0 deletions community-build/community-projects/discipline
Submodule discipline added at 4e3f96
1 change: 1 addition & 0 deletions community-build/community-projects/discipline-munit
Submodule discipline-munit added at e0a3ae
1 change: 1 addition & 0 deletions community-build/community-projects/discipline-specs2
Submodule discipline-specs2 added at b2fa93
1 change: 1 addition & 0 deletions community-build/community-projects/simulacrum-scalafix
Submodule simulacrum-scalafix added at 75f7e1
91 changes: 86 additions & 5 deletions community-build/src/scala/dotty/communitybuild/projects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ def exec(projectDir: Path, binary: String, arguments: String*): Int =
* projects to output the version number to a file.
*/
object Versions:
val cats = "2.3.1-SNAPSHOT"
val catsMtl = "1.1+DOTTY-SNAPSHOT"
val coop = "1.0+DOTTY-SNAPSHOT"
val discipline = "1.1.3-SNAPSHOT"
val disciplineMunit = "1.0.3+DOTTY-SNAPSHOT"
val disciplineSpecs2 = "1.1.3-SNAPSHOT"
val scalacheck = "1.15.2-SNAPSHOT"
val scalatest = "3.2.3"
val munit = "0.7.19+DOTTY-SNAPSHOT"
val scodecBits = "1.1+DOTTY-SNAPSHOT"
val simulacrumScalafix = "0.5.1-SNAPSHOT"

sealed trait CommunityProject:
private var published = false
Expand Down Expand Up @@ -114,6 +121,32 @@ final case class SbtCommunityProject(
s""""org.scalameta" %% "junit-interface" % "${Versions.munit}"""",
s""""org.scodec" %% "scodec-bits" % "${Versions.scodecBits}"""",
s""""org.scodec" %% "scodec-bits_sjs1" % "${Versions.scodecBits}"""",
s""""org.typelevel" %% "discipline-core" % "${Versions.discipline}"""",
s""""org.typelevel" %% "discipline-core_sjs1" % "${Versions.discipline}"""",
s""""org.typelevel" %% "discipline-munit" % "${Versions.disciplineMunit}"""",
s""""org.typelevel" %% "discipline-munit_sjs1" % "${Versions.disciplineMunit}"""",
s""""org.typelevel" %% "discipline-specs2" % "${Versions.disciplineSpecs2}"""",
s""""org.typelevel" %% "discipline-specs2_sjs1" % "${Versions.disciplineSpecs2}"""",
s""""org.typelevel" %% "simulacrum-scalafix-annotations" % "${Versions.simulacrumScalafix}"""",
s""""org.typelevel" %% "simulacrum-scalafix-annotations_sjs1" % "${Versions.simulacrumScalafix}"""",
s""""org.typelevel" %% "cats-core" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-core_sjs1" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-free" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-free_sjs1" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-kernel" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-kernel_sjs1" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-kernel-laws" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-kernel-laws_sjs1" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-laws" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-laws_sjs1" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-testkit" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-testkit_sjs1" % "${Versions.cats}"""",
s""""org.typelevel" %% "cats-mtl" % "${Versions.catsMtl}"""",
s""""org.typelevel" %% "cats-mtl_sjs1" % "${Versions.catsMtl}"""",
s""""org.typelevel" %% "cats-mtl-laws" % "${Versions.catsMtl}"""",
s""""org.typelevel" %% "cats-mtl-laws_sjs1" % "${Versions.catsMtl}"""",
s""""org.typelevel" %% "coop" % "${Versions.coop}"""",
s""""org.typelevel" %% "coop_sjs1" % "${Versions.coop}"""",
)

private val baseCommand =
Expand Down Expand Up @@ -426,15 +459,15 @@ object projects:
lazy val catsEffect2 = SbtCommunityProject(
project = "cats-effect-2",
sbtTestCommand = "test",
// Currently is excluded from community build
// sbtDocCommand = ";coreJVM/doc ;lawsJVM/doc",
sbtDocCommand = ";coreJVM/doc ;lawsJVM/doc",
dependencies = List(cats, disciplineMunit)
)

lazy val catsEffect3 = SbtCommunityProject(
project = "cats-effect-3",
sbtTestCommand = "testIfRelevant",
// The problem is that testIfRelevant does not compile and project does not compile
// sbtDocCommand = ";coreJVM/doc ;lawsJVM/doc ;kernelJVM/doc",
sbtTestCommand = "test",
sbtDocCommand = ";coreJVM/doc ;lawsJVM/doc ;kernelJVM/doc",
dependencies = List(cats, coop, disciplineSpecs2, scalacheck)
)

lazy val scalaParallelCollections = SbtCommunityProject(
Expand All @@ -455,6 +488,54 @@ object projects:
sbtDocCommand = "verifyJVM/doc",
)

lazy val discipline = SbtCommunityProject(
project = "discipline",
sbtTestCommand = "coreJVM/test;coreJS/test",
sbtPublishCommand = "set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal",
dependencies = List(scalacheck)
)

lazy val disciplineMunit = SbtCommunityProject(
project = "discipline-munit",
sbtTestCommand = "test",
sbtPublishCommand = s"""set every version := "${Versions.disciplineMunit}";coreJVM/publishLocal;coreJS/publishLocal""",
dependencies = List(discipline, munit)
)

lazy val disciplineSpecs2 = SbtCommunityProject(
project = "discipline-specs2",
sbtTestCommand = "test",
sbtPublishCommand = "coreJVM/publishLocal;coreJS/publishLocal",
dependencies = List(discipline)
)

lazy val simulacrumScalafixAnnotations = SbtCommunityProject(
project = "simulacrum-scalafix",
sbtTestCommand = "annotation/test:compile;annotationJS/test:compile",
sbtPublishCommand = "annotation/publishLocal;annotationJS/publishLocal",
)

lazy val cats = SbtCommunityProject(
project = "cats",
sbtTestCommand = "set scalaJSStage in Global := FastOptStage;buildJVM;validateAllJS",
sbtPublishCommand = "catsJVM/publishLocal;catsJS/publishLocal",
dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations)
)

lazy val catsMtl = SbtCommunityProject(
project = "cats-mtl",
sbtTestCommand = "testsJVM/test;testsJS/test",
sbtPublishCommand = s"""set every version := "${Versions.catsMtl}";coreJVM/publishLocal;coreJS/publishLocal;lawsJVM/publishLocal;lawsJS/publishLocal""",
dependencies = List(cats, disciplineMunit)
)

lazy val coop = SbtCommunityProject(
project = "coop",
sbtTestCommand = "test",
sbtPublishCommand = s"""set every version := "${Versions.coop}";coreJVM/publishLocal;coreJS/publishLocal""",
dependencies = List(cats, catsMtl)
)

end projects

def allProjects = projects.fields.of[CommunityProject].sortBy(_.project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ end CommunityBuildTest

@Category(Array(classOf[TestCategory]))
class CommunityBuildTestA extends CommunityBuildTest:
@Test def endpoints4s = projects.endpoints4s.run()
@Test def fansi = projects.fansi.run()
@Test def fastparse = projects.fastparse.run()
@Test def geny = projects.geny.run()
Expand All @@ -90,44 +91,49 @@ class CommunityBuildTestA extends CommunityBuildTest:
@Test def pprint = projects.pprint.run()
@Test def requests = projects.requests.run()
@Test def scalacheck = projects.scalacheck.run()
@Test def scalaCollectionCompat = projects.scalaCollectionCompat.run()
@Test def scalaParallelCollections = projects.scalaParallelCollections.run()
@Test def scalatest = projects.scalatest.run()
@Test def scalatestplusScalacheck = projects.scalatestplusScalacheck.run()
@Test def scalaz = projects.scalaz.run()
@Test def sourcecode = projects.sourcecode.run()
@Test def stdLib213 = projects.stdLib213.run()
@Test def ujson = projects.ujson.run()
@Test def upickle = projects.upickle.run()
@Test def utest = projects.utest.run()
@Test def zio = projects.zio.run()
end CommunityBuildTestA

@Category(Array(classOf[TestCategory]))
class CommunityBuildTestB extends CommunityBuildTest:
@Test def algebra = projects.algebra.run()
@Test def betterfiles = projects.betterfiles.run()
// temporarily disabled due to lampepfl/dotty#10478
//@Test def catsEffect2 = projects.catsEffect2.run()
//@Test def catsEffect3 = projects.catsEffect3.run()
@Test def cats = projects.cats.run()
@Test def catsEffect2 = projects.catsEffect2.run()
@Test def catsEffect3 = projects.catsEffect3.run()
@Test def catsMtl = projects.catsMtl.run()
@Test def coop = projects.coop.run()
@Test def discipline = projects.discipline.run()
@Test def disciplineMunit = projects.disciplineMunit.run()
@Test def disciplineSpecs2 = projects.disciplineSpecs2.run()
// Temporarily disabled until problem discovered in comments to #9449 is fixed
// @Test def dottyCpsAsync = projects.dottyCpsAsync.run()
@Test def effpi = projects.effpi.run()
@Test def endpoints4s = projects.endpoints4s.run()
@Test def intent = projects.intent.run()
@Test def minitest = projects.minitest.run()
@Test def munit = projects.munit.run()
@Test def scodec = projects.scodec.run()
@Test def scodecBits = projects.scodecBits.run()
@Test def scalap = projects.scalap.run()
@Test def scalaCollectionCompat = projects.scalaCollectionCompat.run()
@Test def scalaParallelCollections = projects.scalaParallelCollections.run()
@Test def scalaParserCombinators = projects.scalaParserCombinators.run()
@Test def ScalaPB = projects.ScalaPB.run()
@Test def scalaXml = projects.scalaXml.run()
@Test def scalaz = projects.scalaz.run()
@Test def scas = projects.scas.run()
@Test def sconfig = projects.sconfig.run()
@Test def shapeless = projects.shapeless.run()
@Test def stdLib213 = projects.stdLib213.run()
@Test def simulacrumScalafixAnnotations = projects.simulacrumScalafixAnnotations.run()
@Test def verify = projects.verify.run()
@Test def xmlInterpolator = projects.xmlInterpolator.run()
@Test def zio = projects.zio.run()
end CommunityBuildTestB

class TestCategory