-
Notifications
You must be signed in to change notification settings - Fork 46
/
build.sbt
41 lines (33 loc) · 1.15 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
addCommandAlias("pyDocs", "pyrasterframes/doc")
addCommandAlias("pyTest", "pyrasterframes/test")
addCommandAlias("pyBuild", "pyrasterframes/package")
exportJars := true
Python / doc / sourceDirectory := (Python / target).value / "docs"
Python / doc / target := (Python / target).value / "docs"
Python / doc := (Python / doc / target).toTask.dependsOn(
Def.sequential(
assembly,
Test / compile,
pySetup.toTask(" pweave --quick True")
)
).value
doc := (Python / doc).value
val nbInclude = Def.setting[FileFilter](GlobFilter("*.ipynb"))
lazy val pyNotebooks = taskKey[Seq[File]]("Convert relevant scripts into notebooks")
pyNotebooks := {
val _ = pySetup.toTask(" notebooks").value
((Python / doc / target).value ** "*.ipynb").get()
}
lazy val pySparkCmd = taskKey[Unit]("Create build and emit command to run in pyspark")
pySparkCmd := {
val s = streams.value
val py = (Python / packageBin).value
val script = IO.createTemporaryDirectory / "pyrf_init.py"
IO.write(script, """
import pyrasterframes
from pyrasterframes.rasterfunctions import *
""")
val msg = s"PYTHONSTARTUP=$script pyspark --py-files $py"
s.log.debug(msg)
println(msg)
}