From dde2e6a82a366308ef49d73832035562466354f9 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 17 Aug 2024 13:52:52 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.8.3 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 143d6bd..ade37b7 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,5 +1,5 @@ align.preset = "more" maxColumn = 100 -version=3.8.2 +version=3.8.3 runner.dialect = scala3 indent.main = 3 From 8f04588e2bee81f0e6b5df73a0bf636a00090bca Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 17 Aug 2024 13:53:02 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.8.3 Executed command: scalafmt --non-interactive --- .../src/main/scala/ORTOperatorBackend.scala | 7 ++- build.sbt | 63 +++++++++++-------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/backends/.js/src/main/scala/ORTOperatorBackend.scala b/backends/.js/src/main/scala/ORTOperatorBackend.scala index 54037a6..24ff86e 100644 --- a/backends/.js/src/main/scala/ORTOperatorBackend.scala +++ b/backends/.js/src/main/scala/ORTOperatorBackend.scala @@ -5,7 +5,9 @@ import scala.concurrent.duration._ import org.emergentorder.onnx.onnxruntimeCommon.tensorMod //import typings.onnxruntimeWeb.tensorMod.Tensor.DataType //import typings.onnxjs.libTensorMod.Tensor.DataTypeMap.DataTypeMapOps -import org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionImplMod.{InferenceSession => OrtSession} +import org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionImplMod.{ + InferenceSession => OrtSession +} import org.emergentorder.onnx.onnxruntimeCommon.mod.Tensor.{^ => OnnxTensor} //import typings.onnxruntimeWeb.ort.InferenceSession.{^ => InferenceSess} //import typings.onnxjs.onnxMod.Onnx @@ -347,7 +349,8 @@ trait ORTOperatorBackend extends OpToONNXBytesConverter { org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionMod.InferenceSession ] = IO.fromFuture { IO { - val infSess = OrtSession.create("squeezenet1.0-12.onnx", InferenceSession.SessionOptions()) + val infSess = + OrtSession.create("squeezenet1.0-12.onnx", InferenceSession.SessionOptions()) Future( infSess.asInstanceOf[ org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionMod.InferenceSession diff --git a/build.sbt b/build.sbt index d5eebc2..32daecb 100755 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,7 @@ lazy val commonSettings = Seq( resolvers += Resolver.mavenLocal, resolvers += "Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots", updateOptions := updateOptions.value.withLatestSnapshots(false), - libraryDependencies += "com.google.protobuf" % "protobuf-java" % "4.27.3", + libraryDependencies += "com.google.protobuf" % "protobuf-java" % "4.27.3", libraryDependencies += "org.scala-lang" % "scala3-compiler_3" % scalaVersion.value exclude ( "org.scala-sbt", "compiler-interface" @@ -75,7 +75,7 @@ val copyPackageNoExports = taskKey[Unit]("Copy package file without exports to t lazy val backends = (crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) in file("backends")) .dependsOn(core) - .settings( + .settings( commonSettings, name := "onnx-scala-backends", mimaPreviousArtifacts := Set("org.emergent-order" %%% "onnx-scala-backends" % "0.17.0"), @@ -102,35 +102,48 @@ lazy val backends = (crossProject(JSPlatform, JVMPlatform) Compile / npmDependencies += "onnxruntime-common" -> "1.18.0", Compile / npmDependencies += "typescript" -> "5.4.5", copyIndexTs := { - import Path._ - - val src = new File(".") + import Path._ - // get the files we want to copy - val htmlFiles: Seq[File] = Seq(new File("index.d.ts")) + val src = new File(".") - // use Path.rebase to pair source files with target destination in crossTarget - val pairs = htmlFiles pair rebase(src, (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/main/node_modules/onnxruntime-node/dist/types.d.ts") + // get the files we want to copy + val htmlFiles: Seq[File] = Seq(new File("index.d.ts")) - // Copy files to source files to target - IO.copy(pairs, CopyOptions.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false)) + // use Path.rebase to pair source files with target destination in crossTarget + val pairs = htmlFiles pair rebase( + src, + (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/main/node_modules/onnxruntime-node/dist/types.d.ts" + ) -}, + // Copy files to source files to target + IO.copy( + pairs, + CopyOptions + .apply(overwrite = true, preserveLastModified = true, preserveExecutable = false) + ) + }, copyPackageNoExports := { - import Path._ - - val src = new File(".") - - // get the files we want to copy - val htmlFiles: Seq[File] = Seq(new File("package.json")) - - // use Path.rebase to pair source files with target destination in crossTarget - val pairs = htmlFiles pair rebase(src, (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/test/node_modules/onnxruntime-common") - - // Copy files to source files to target - IO.copy(pairs, CopyOptions.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false)) -}, + import Path._ + + val src = new File(".") + + // get the files we want to copy + val htmlFiles: Seq[File] = Seq(new File("package.json")) + + // use Path.rebase to pair source files with target destination in crossTarget + val pairs = htmlFiles pair rebase( + src, + (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/test/node_modules/onnxruntime-common" + ) + + // Copy files to source files to target + IO.copy( + pairs, + CopyOptions + .apply(overwrite = true, preserveLastModified = true, preserveExecutable = false) + ) + }, Compile / compile := (Compile / compile dependsOn (copyIndexTs, copyPackageNoExports)).value, libraryDependencies += "org.typelevel" %%% "cats-effect-testing-scalatest" % "1.5.0" % Test, stOutputPackage := "org.emergentorder.onnx", From 96273151868f26e291ebb351e59b8be81705f84e Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 17 Aug 2024 13:53:02 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.8.3' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4f82ec4..b263059 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -12,3 +12,6 @@ aa0af90da52c49fd157e23ae5e3e148667a17fcd # Scala Steward: Reformat with scalafmt 3.8.2 394ff5b312131bd5afaa0cfdbefead351f66987c + +# Scala Steward: Reformat with scalafmt 3.8.3 +8f04588e2bee81f0e6b5df73a0bf636a00090bca