-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* assembly * test some objects consumable from pyspark * experimenting with pyc files in jar * a working prototype of scala & python in same maven jar file * draft of python-side TDigestUDT and TDigest * cdf method for python TDigest * cdfInverse, also some doc * comment * cdfDiscrete, cdfDiscreteInverse, and sampling methods * Restore pyc in jars, clean up python bindings for UDAFs * fill in some missing method overrides for TDigestArrayUDT * fix typo tdigestFloatUDAF * TDigestArrayUDT for python * T-Digest reducing UDAFs * add some doc * document reducing variants * bump version, add sonatype publishing, py/spark version suffixes * python examples for readme
- Loading branch information
1 parent
00a7c3f
commit 16af0ef
Showing
13 changed files
with
1,020 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,65 @@ organization := "org.isarnproject" | |
|
||
bintrayOrganization := Some("isarn") | ||
|
||
version := "0.1.0" | ||
val packageVersion = "0.2.0" | ||
|
||
val sparkVersion = "2.2.0" | ||
|
||
val pythonVersion = "2.7" | ||
|
||
val sparkSuffix = s"""sp${sparkVersion.split('.').take(2).mkString(".")}""" | ||
|
||
val pythonSuffix = s"""py${pythonVersion.split('.').take(2).mkString(".")}""" | ||
|
||
val pythonCMD = s"""python${pythonVersion.split('.').head}""" | ||
|
||
version := s"${packageVersion}-${sparkSuffix}-${pythonSuffix}" | ||
|
||
scalaVersion := "2.11.8" | ||
|
||
crossScalaVersions := Seq("2.10.6", "2.11.8") | ||
|
||
useGpg := true | ||
|
||
pomIncludeRepository := { _ => false } | ||
|
||
publishMavenStyle := true | ||
|
||
publishTo := { | ||
val nexus = "https://oss.sonatype.org/" | ||
if (isSnapshot.value) | ||
Some("snapshots" at nexus + "content/repositories/snapshots") | ||
else | ||
Some("releases" at nexus + "service/local/staging/deploy/maven2") | ||
} | ||
|
||
licenses += ("Apache-2.0", url("http://opensource.org/licenses/Apache-2.0")) | ||
|
||
homepage := Some(url("https://github.com/isarn/isarn-sketches-spark")) | ||
|
||
scmInfo := Some( | ||
ScmInfo( | ||
url("https://github.com/isarn/isarn-sketches-spark"), | ||
"scm:[email protected]:isarn/isarn-sketches-spark.git" | ||
) | ||
) | ||
|
||
developers := List( | ||
Developer( | ||
id = "erikerlandson", | ||
name = "Erik Erlandson", | ||
email = "[email protected]", | ||
url = url("https://erikerlandson.github.io/") | ||
) | ||
) | ||
|
||
def commonSettings = Seq( | ||
libraryDependencies ++= Seq( | ||
"org.isarnproject" %% "isarn-sketches" % "0.1.0", | ||
"org.apache.spark" %% "spark-core" % "2.1.0" % Provided, | ||
"org.apache.spark" %% "spark-sql" % "2.1.0" % Provided, | ||
"org.apache.spark" %% "spark-mllib" % "2.1.0" % Provided, | ||
"org.isarnproject" %% "isarn-scalatest" % "0.0.1" % Test, | ||
"org.isarnproject" %% "isarn-sketches" % "0.1.1", | ||
"org.apache.spark" %% "spark-core" % sparkVersion % Provided, | ||
"org.apache.spark" %% "spark-sql" % sparkVersion % Provided, | ||
"org.apache.spark" %% "spark-mllib" % sparkVersion % Provided, | ||
"org.isarnproject" %% "isarn-scalatest" % "0.0.2" % Test, | ||
"org.scalatest" %% "scalatest" % "2.2.4" % Test, | ||
"org.apache.commons" % "commons-math3" % "3.6.1" % Test), | ||
initialCommands in console := """ | ||
|
@@ -45,6 +91,53 @@ licenses += ("Apache-2.0", url("http://opensource.org/licenses/Apache-2.0")) | |
|
||
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature") | ||
|
||
lazy val deletePYC = taskKey[Unit]("Delete .pyc files") | ||
|
||
deletePYC := { | ||
val s: TaskStreams = streams.value | ||
s.log.info("delete .pyc files...") | ||
val cmd = "bash" :: "-c" :: "rm -f $(find python -name *.pyc)" :: Nil | ||
val stat = (cmd !) | ||
if (stat == 0) { | ||
s.log.info("delete .pyc succeeded") | ||
} else { | ||
throw new IllegalStateException("delete .pyc failed") | ||
} | ||
} | ||
|
||
lazy val compilePython = taskKey[Unit]("Compile python files") | ||
|
||
compilePython := { | ||
val s: TaskStreams = streams.value | ||
s.log.info("compiling python...") | ||
val stat = (Seq(pythonCMD, "-m", "compileall", "python/") !) | ||
if (stat == 0) { | ||
s.log.info("python compile succeeded") | ||
} else { | ||
throw new IllegalStateException("python compile failed") | ||
} | ||
} | ||
|
||
compilePython <<= compilePython.dependsOn(deletePYC) | ||
|
||
(packageBin in Compile) <<= (packageBin in Compile).dependsOn(compilePython) | ||
|
||
mappings in (Compile, packageBin) ++= Seq( | ||
(baseDirectory.value / "python" / "isarnproject" / "__init__.pyc") -> "isarnproject/__init__.pyc", | ||
(baseDirectory.value / "python" / "isarnproject" / "sketches" / "__init__.pyc") -> "isarnproject/sketches/__init__.pyc", | ||
(baseDirectory.value / "python" / "isarnproject" / "sketches" / "udaf" / "__init__.pyc") -> "isarnproject/sketches/udaf/__init__.pyc", | ||
(baseDirectory.value / "python" / "isarnproject" / "sketches" / "udaf" / "tdigest.pyc") -> "isarnproject/sketches/udaf/tdigest.pyc", | ||
(baseDirectory.value / "python" / "isarnproject" / "sketches" / "udt" / "__init__.pyc") -> "isarnproject/sketches/udt/__init__.pyc", | ||
(baseDirectory.value / "python" / "isarnproject" / "sketches" / "udt" / "tdigest.pyc") -> "isarnproject/sketches/udt/tdigest.pyc" | ||
) | ||
|
||
test in assembly := {} | ||
|
||
assemblyShadeRules in assembly := Seq( | ||
ShadeRule.zap("scala.**").inAll, | ||
ShadeRule.zap("org.slf4j.**").inAll | ||
) | ||
|
||
scalacOptions in (Compile, doc) ++= Seq("-doc-root-content", baseDirectory.value+"/root-doc.txt") | ||
|
||
site.settings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.4") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Oops, something went wrong.