Skip to content

Commit 8025286

Browse files
committed
Misc version fiddling.
1 parent 44f4072 commit 8025286

File tree

10 files changed

+19
-41
lines changed

10 files changed

+19
-41
lines changed

datasource/src/main/scala/org/locationtech/rasterframes/datasource/tiles/TilesDataSource.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class TilesDataSource extends DataSourceRegister with CreatableRelationProvider
8787
val fName = "catalog.csv"
8888
val hPath = new Path(new Path(pathURI), "_" + fName)
8989
pipeline
90-
.coalesce(1)
9190
.write
9291
.option("header", "true")
9392
.csv(hPath.toString)

project/PythonBuildPlugin.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ object PythonBuildPlugin extends AutoPlugin {
8383
val log = streams.value.log
8484
val buildDir = (Python / target).value
8585
val asmbl = (Compile / assembly).value
86-
val dest = buildDir / "deps" / "jars" / asmbl.getName
86+
val dest = buildDir / "pyrasterframes" / "jars" / asmbl.getName
8787
IO.copyFile(asmbl, dest)
8888
log.info(s"PyRasterFrames assembly written to '$dest'")
8989
dest
@@ -93,7 +93,7 @@ object PythonBuildPlugin extends AutoPlugin {
9393
val log = streams.value.log
9494
val buildDir = (Python / target).value
9595

96-
val jars = (buildDir / "deps" / "jars" ** "*.jar").get()
96+
val jars = (buildDir / "pyrasterframes" / "jars" ** "*.jar").get()
9797
if (jars.size > 1) {
9898
throw new MessageOnlyException("Two assemblies found in the package. Run 'clean'.\n" + jars.mkString(", "))
9999
}

project/RFDependenciesPlugin.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ object RFDependenciesPlugin extends AutoPlugin {
6969
"oss-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
7070
"jitpack" at "https://jitpack.io"
7171
),
72-
// dependencyOverrides += "com.azavea.gdal" % "gdal-warp-bindings" % "33.f746890",
7372
// NB: Make sure to update the Spark version in pyrasterframes/python/setup.py
7473
rfSparkVersion := "3.1.2",
75-
rfGeoTrellisVersion := "3.6.1-SNAPSHOT",
76-
rfGeoMesaVersion := "3.2.0"
74+
rfGeoTrellisVersion := "3.6.1",
75+
rfGeoMesaVersion := "3.2.0",
76+
excludeDependencies += "log4j" % "log4j"
7777
)
7878
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22
global-exclude *.py[cod] __pycache__ .DS_Store
3-
recursive-include deps/jars *.jar
3+
recursive-include pyrasterframes/jars *.jar

pyrasterframes/src/main/python/deps/jars/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyrasterframes/src/main/python/pyrasterframes/pyproject.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyrasterframes/src/main/python/pyrasterframes/utils.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
from pyspark import SparkConf
2424
import os
2525
from . import RFContext
26-
from typing import Union, Dict
26+
from typing import Union, Dict, Optional
2727

28-
__all__ = ["create_rf_spark_session", "find_pyrasterframes_jar_dir", "find_pyrasterframes_assembly", "gdal_version", 'is_notebook', 'gdal_version', 'build_info', 'quiet_logs']
28+
__all__ = ["create_rf_spark_session", "find_pyrasterframes_jar_dir", "find_pyrasterframes_assembly", "gdal_version", 'gdal_version', 'build_info', 'quiet_logs']
2929

3030

3131
def find_pyrasterframes_jar_dir() -> str:
@@ -39,20 +39,10 @@ def find_pyrasterframes_jar_dir() -> str:
3939
try:
4040
module_home = find_spec("pyrasterframes").origin
4141
jar_dir = os.path.join(os.path.dirname(module_home), 'jars')
42-
except ImportError:
43-
pass
44-
45-
# Case for when we're running from source build
46-
if jar_dir is None or not os.path.exists(jar_dir):
47-
def pdir(curr):
48-
return os.path.dirname(curr)
49-
50-
here = pdir(os.path.realpath(__file__))
51-
target_dir = pdir(pdir(here))
52-
# See if we're running outside of sbt build and adjust
53-
if os.path.basename(target_dir) != "target":
54-
target_dir = os.path.join(pdir(pdir(target_dir)), 'target')
55-
jar_dir = os.path.join(target_dir, 'scala-2.12')
42+
except ImportError as e:
43+
import logging
44+
logging.critical("Error finding runtime JAR directory", exc_info=e)
45+
raise e
5646

5747
return os.path.realpath(jar_dir)
5848

@@ -62,9 +52,9 @@ def find_pyrasterframes_assembly() -> Union[bytes, str]:
6252
jarpath = glob.glob(os.path.join(jar_dir, 'pyrasterframes-assembly*.jar'))
6353

6454
if not len(jarpath) == 1:
65-
raise RuntimeError("""
66-
Expected to find exactly one assembly. Found '{}' instead.
67-
Try running 'sbt pyrasterframes/clean pyrasterframes/package' first. """.format(jarpath))
55+
raise RuntimeError(f"""
56+
Expected to find exactly one assembly in '{jar_dir}'.
57+
Found '{jarpath}' instead.""")
6858
return jarpath[0]
6959

7060

@@ -74,7 +64,7 @@ def quiet_logs(sc):
7464
logger.LogManager.getLogger("akka").setLevel(logger.Level.ERROR)
7565

7666

77-
def create_rf_spark_session(master="local[*]", **kwargs: str) -> SparkSession:
67+
def create_rf_spark_session(master="local[*]", **kwargs: str) -> Optional[SparkSession]:
7868
""" Create a SparkSession with pyrasterframes enabled and configured. """
7969
jar_path = find_pyrasterframes_assembly()
8070

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# These packages should be installed from conda-forge, given their complex binary components.
2-
gdal==3.1.2
2+
gdal
33
rasterio[s3]
44
rtree

pyrasterframes/src/main/python/setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def dest_file(self, src_file):
147147
matplotlib = 'matplotlib'
148148
fiona = 'fiona'
149149
folium = 'folium'
150-
gdal = 'gdal==3.1.2'
150+
gdal = 'gdal'
151151
geopandas = 'geopandas'
152152
ipykernel = 'ipykernel'
153153
ipython = 'ipython'
@@ -232,9 +232,6 @@ def dest_file(self, src_file):
232232
'geomesa_pyspark',
233233
'pyrasterframes.jars',
234234
],
235-
package_dir={
236-
'pyrasterframes.jars': 'deps/jars'
237-
},
238235
package_data={
239236
'pyrasterframes.jars': ['*.jar']
240237
},

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ThisBuild / version := "0.10.1-SNAPSHOT"
1+
ThisBuild / version := "0.10.1"

0 commit comments

Comments
 (0)