Skip to content

Commit

Permalink
Fix CHANGELOG feature of aggregator
Browse files Browse the repository at this point in the history
related to #97 and #117
  • Loading branch information
soxofaan committed Sep 30, 2024
1 parent f52ac96 commit 23fc1c3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/openeo_aggregator/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from typing import Optional

__version__ = "0.39.1a1"
__version__ = "0.39.2a1"


def log_version_info(logger: Optional[logging.Logger] = None):
Expand Down
33 changes: 27 additions & 6 deletions src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import dataclasses
import datetime
import functools
import importlib
import importlib.metadata
import logging
import pathlib
import re
Expand All @@ -27,6 +29,7 @@
import openeo
import openeo.rest
import openeo_driver.errors
import openeo_driver.util.changelog
import openeo_driver.util.view_helpers
from openeo.capabilities import ComparableVersion
from openeo.rest import (
Expand Down Expand Up @@ -1601,9 +1604,27 @@ def postprocess_capabilities(self, capabilities: dict) -> dict:
capabilities["_partitioned_job_tracking"] = bool(self.batch_jobs.partitioned_job_tracker)
return capabilities

def changelog(self) -> Union[str, pathlib.Path]:
# TODO: What is path of CHANGELOG.md in docker container? It's probably not even there yet #97
changelog = pathlib.Path(__file__).parent.parent.parent / "CHANGELOG.md"
if changelog.exists():
return changelog
return super().changelog()
def changelog(self) -> Union[str, pathlib.Path, flask.Response]:
html = openeo_driver.util.changelog.multi_project_changelog(
[
{
"name": "openeo-aggregator",
"version": importlib.metadata.version(distribution_name="openeo-aggregator"),
"changelog_path": openeo_driver.util.changelog.get_changelog_path(
data_files_dir="openeo-aggregator-data",
src_root=pathlib.Path(openeo_aggregator.__file__).parent.parent.parent,
filename="CHANGELOG.md",
),
},
{
"name": "openeo-python-driver",
"version": importlib.metadata.version(distribution_name="openeo_driver"),
"changelog_path": openeo_driver.util.changelog.get_changelog_path(
data_files_dir="openeo-python-driver-data",
src_root=pathlib.Path(openeo_driver.__file__).parent.parent,
filename="CHANGELOG.md",
),
},
]
)
return flask.make_response(html, {"Content-Type": "text/html"})

0 comments on commit 23fc1c3

Please sign in to comment.