Skip to content

updated to 2.13-M5 #2589

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 13 commits into from
Nov 8, 2018
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ git:

scala:
- 2.11.12
- 2.13.0-M4
- 2.12.6
- 2.13.0-M5
- 2.12.7

jdk:
- oraclejdk8
Expand Down
32 changes: 19 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ lazy val catsSettings = Seq(
"bintray/non".at("http://dl.bintray.com/non/maven")
),
libraryDependencies ++= Seq(
"org.typelevel" %%% "machinist" % "0.6.5",
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.7")
"org.typelevel" %%% "machinist" % "0.6.6",
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8")
) ++ macroDependencies(scalaVersion.value),
) ++ commonSettings ++ publishSettings ++ scoverageSettings ++ simulacrumSettings

lazy val simulacrumSettings = Seq(
libraryDependencies += "com.github.mpilquist" %%% "simulacrum" % "0.13.0" % Provided,
libraryDependencies += "com.github.mpilquist" %%% "simulacrum" % "0.14.0" % Provided,
pomPostProcess := { (node: xml.Node) =>
new RuleTransformer(new RewriteRule {
override def transform(node: xml.Node): Seq[xml.Node] = node match {
Expand Down Expand Up @@ -132,10 +132,10 @@ lazy val includeGeneratedSrc: Setting[_] = {

// 2.13.0-M4 workarounds
def catalystsVersion(scalaVersion: String): String =
if (priorTo2_13(scalaVersion)) "0.6" else "0.7"
if (priorTo2_13(scalaVersion)) "0.6" else "0.8"

def scalatestVersion(scalaVersion: String): String =
if (priorTo2_13(scalaVersion)) "3.0.5" else "3.0.6-SNAP1"
if (priorTo2_13(scalaVersion)) "3.0.5" else "3.0.6-SNAP5"

def scalaCheckVersion(scalaVersion: String): String =
if (priorTo2_13(scalaVersion)) "1.13.5" else "1.14.0"
Expand All @@ -151,8 +151,6 @@ lazy val disciplineDependencies = Seq(
lazy val testingDependencies = Seq(
libraryDependencies += "org.typelevel" %%% "catalysts-platform" % catalystsVersion(scalaVersion.value),
libraryDependencies += "org.typelevel" %%% "catalysts-macros" % catalystsVersion(scalaVersion.value) % "test",
// 2.13.0-M3 workaround
// libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion % "test")
libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion(scalaVersion.value) % "test"
)

Expand Down Expand Up @@ -216,7 +214,7 @@ lazy val docSettings = Seq(
Seq("-Yno-adapted-args")
else
Seq("-Ymacro-annotations")),
scalacOptions in Tut ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))),
scalacOptions in Tut ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports", "-Ywarn-dead-code"))),
git.remoteRepo := "git@github.com:typelevel/cats.git",
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.yml" | "*.md" | "*.svg",
includeFilter in Jekyll := (includeFilter in makeSite).value
Expand Down Expand Up @@ -478,11 +476,11 @@ lazy val testsJS = tests.js
lazy val testkit = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(macros, core, laws)
.enablePlugins(BuildInfoPlugin)
.settings(buildInfoKeys := Seq[BuildInfoKey](scalaVersion), buildInfoPackage := "cats.tests")
.settings(moduleName := "cats-testkit")
.settings(catsSettings)
.settings(disciplineDependencies)
// 2.13.0-M3 workaround
//.settings(libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion)
.settings(libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion(scalaVersion.value))
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)
Expand All @@ -506,7 +504,7 @@ lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform)
.settings(includeGeneratedSrc)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)
.settings(scalacOptions ~= { _.filterNot("-Ywarn-unused-import" == _) }) //export-hook triggers unused import
.settings(scalacOptions ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) }) //export-hook triggers unused import

lazy val alleycatsCoreJVM = alleycatsCore.jvm
lazy val alleycatsCoreJS = alleycatsCore.js
Expand Down Expand Up @@ -789,8 +787,16 @@ lazy val sharedReleaseProcess = Seq(
)

lazy val warnUnusedImport = Seq(
scalacOptions ++= Seq("-Ywarn-unused-import"),
scalacOptions in (Compile, console) ~= { _.filterNot("-Ywarn-unused-import" == _) },
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 11)) =>
Seq("-Ywarn-unused-import")
case Some((2, n)) if n >= 12 =>
Seq("-Ywarn-unused:imports")

}
},
scalacOptions in (Compile, console) ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) },
scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package cats.kernel
package compat


private[kernel] object TraversableOnce {
private[kernel] object TraversableOnce {
def reduceOption[A, A1 >: A](as: TraversableOnce[A], op: (A1, A1) => A1): Option[A1] =
as.iterator.reduceOption(op)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package compat

import scala.collection.mutable


private[kernel] abstract class WrappedMutableMapBase[K, V](m: mutable.Map[K, V]) extends Map[K, V] {
abstract private[kernel] class WrappedMutableMapBase[K, V](m: mutable.Map[K, V]) extends Map[K, V] {
def updated[V2 >: V](key: K, value: V2): Map[K, V2] = m.toMap + ((key, value))
def remove(key: K): Map[K, V] = m.toMap - key
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.3
sbt.version=1.2.6
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.7")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.25")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8")
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
4 changes: 4 additions & 0 deletions tests/src/test/scala/cats/tests/RepresentableSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ class RepresentableSuite extends CatsSuite {
}

{
//the monadInstance below made a conflict to resolve this one.
implicit val isoFun1: Isomorphisms[String => ?] = Isomorphisms.invariant[String => ?]

implicit val monadInstance = Representable.monad[String => ?]
checkAll("String => ?", MonadTests[String => ?].monad[String, String, String])

}

// Syntax tests. If it compiles is "passes"
Expand Down
6 changes: 5 additions & 1 deletion tests/src/test/scala/cats/tests/TrySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ class TrySuite extends CatsSuite {
checkAll("Try[Int]", CoflatMapTests[Try].coflatMap[Int, Int, Int])
checkAll("CoflatMap[Try]", SerializableTests.serializable(CoflatMap[Try]))

checkAll("Try with Throwable", MonadErrorTests[Try, Throwable].monadError[Int, Int, Int])
//temporarily disable this test due to scala.util.Failure regression https://github.com/scala/bug/issues/11242
if (BuildInfo.scalaVersion != "2.13.0-M5") {
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to open an issue in this repo to remind ourselves to remove this hack.

Copy link
Contributor

Choose a reason for hiding this comment

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

done: #2601

Copy link
Contributor Author

Choose a reason for hiding this comment

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

checkAll("Try with Throwable", MonadErrorTests[Try, Throwable].monadError[Int, Int, Int])
}

checkAll("MonadError[Try, Throwable]", SerializableTests.serializable(MonadError[Try, Throwable]))

checkAll("Try[Int] with Option", TraverseTests[Try].traverse[Int, Int, Int, Int, Option, Option])
Expand Down