diff --git a/qgreenland/util/config/export.py b/qgreenland/util/config/export.py index 6912fcf1..c17261cf 100644 --- a/qgreenland/util/config/export.py +++ b/qgreenland/util/config/export.py @@ -22,50 +22,11 @@ get_layer_release_filepath, vector_or_raster, ) -from qgreenland.util.metadata import build_layer_metadata from qgreenland.util.tree import LayerNode -from qgreenland.util.version import get_build_version DEFAULT_LAYER_MANIFEST_PATH = Path("./layers.csv") -def export_config_manifest( - cfg: Config, - output_path: Path = DEFAULT_LAYER_MANIFEST_PATH, -) -> None: - """Write a machine-readable manifest to disk describing available layers. - - This includes layers for which `in_package is False`. - - This must be run after the layers are in their release location, because we - need to calculate their size on disk. - """ - manifest_spec_version = "v0.1.0" - manifest = { - "version": manifest_spec_version, - "qgr_version": get_build_version(), - "layers": [ - { - # ID first for readability - "id": layer_node.layer_cfg.id, - **layer_node.layer_cfg.dict(include={"title", "description", "tags"}), - "hierarchy": layer_node.group_name_path, - "layer_details": build_layer_metadata(layer_node.layer_cfg), - "assets": _layer_manifest_final_assets(layer_node), - } - for layer_node in cfg.layer_tree.leaves - # For now, do not include online layers in the layer manifest. The - # `QGreenland Custom` QGIS Plugin does not currently support online - # layers. Once online layers are supported in the plugin, this `if` - # statement can be removed. - if not isinstance(layer_node.layer_cfg.input.asset, OnlineAsset) - ], - } - - with open(output_path, "w") as ofile: - json.dump(manifest, ofile) - - def export_config_csv( cfg: Config, output_path: Path = DEFAULT_LAYER_MANIFEST_PATH, diff --git a/qgreenland/util/luigi/tasks/pipeline.py b/qgreenland/util/luigi/tasks/pipeline.py index 1037fc8e..55bba521 100644 --- a/qgreenland/util/luigi/tasks/pipeline.py +++ b/qgreenland/util/luigi/tasks/pipeline.py @@ -8,14 +8,13 @@ ANCILLARY_DIR, COMPILE_PACKAGE_DIR, PROJECT_DIR, - RELEASE_LAYERS_DIR, VERSIONED_PACKAGE_DIR, WIP_PACKAGE_DIR, ) from qgreenland.constants.project import ENVIRONMENT, PROJECT from qgreenland.util.cleanup import cleanup_intermediate_dirs from qgreenland.util.config.config import get_config -from qgreenland.util.config.export import export_config_csv, export_config_manifest +from qgreenland.util.config.export import export_config_csv from qgreenland.util.luigi import generate_layer_pipelines from qgreenland.util.luigi.tasks.ancillary import ( AncillaryFile, @@ -78,26 +77,6 @@ def requires(self): yield from tasks -class LayerManifest(luigi.Task): - """A JSON manifest of layers available for access. - - Intended to be processed by machine, e.g. QGIS plugin. - """ - - def output(self): - return luigi.LocalTarget( - RELEASE_LAYERS_DIR / "manifest.json", - ) - - def requires(self): - yield LayerPipelines() - - def run(self): - config = get_config() - with self.output().temporary_path() as temp_path: - export_config_manifest(config, output_path=temp_path) - - class CreateQgisProjectFile(luigi.Task): """Create .qgz/.qgs project file.""" @@ -197,9 +176,14 @@ def run(self): class HostedLayers(luigi.WrapperTask): + """Generate all layers we need to host. + + This is a vestige of the QGreenland Custom QGIS plugin; we no longer need to "host" + layers, except for backwards-compatibility. + """ + def requires(self): yield LayerPipelines() - yield LayerManifest() class QGreenlandAll(luigi.WrapperTask):