Skip to content

Commit 23fc1c3

Browse files
committed
Fix CHANGELOG feature of aggregator
related to #97 and #117
1 parent f52ac96 commit 23fc1c3

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

src/openeo_aggregator/about.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
from typing import Optional
44

5-
__version__ = "0.39.1a1"
5+
__version__ = "0.39.2a1"
66

77

88
def log_version_info(logger: Optional[logging.Logger] = None):

src/openeo_aggregator/backend.py

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import dataclasses
55
import datetime
66
import functools
7+
import importlib
8+
import importlib.metadata
79
import logging
810
import pathlib
911
import re
@@ -27,6 +29,7 @@
2729
import openeo
2830
import openeo.rest
2931
import openeo_driver.errors
32+
import openeo_driver.util.changelog
3033
import openeo_driver.util.view_helpers
3134
from openeo.capabilities import ComparableVersion
3235
from openeo.rest import (
@@ -1601,9 +1604,27 @@ def postprocess_capabilities(self, capabilities: dict) -> dict:
16011604
capabilities["_partitioned_job_tracking"] = bool(self.batch_jobs.partitioned_job_tracker)
16021605
return capabilities
16031606

1604-
def changelog(self) -> Union[str, pathlib.Path]:
1605-
# TODO: What is path of CHANGELOG.md in docker container? It's probably not even there yet #97
1606-
changelog = pathlib.Path(__file__).parent.parent.parent / "CHANGELOG.md"
1607-
if changelog.exists():
1608-
return changelog
1609-
return super().changelog()
1607+
def changelog(self) -> Union[str, pathlib.Path, flask.Response]:
1608+
html = openeo_driver.util.changelog.multi_project_changelog(
1609+
[
1610+
{
1611+
"name": "openeo-aggregator",
1612+
"version": importlib.metadata.version(distribution_name="openeo-aggregator"),
1613+
"changelog_path": openeo_driver.util.changelog.get_changelog_path(
1614+
data_files_dir="openeo-aggregator-data",
1615+
src_root=pathlib.Path(openeo_aggregator.__file__).parent.parent.parent,
1616+
filename="CHANGELOG.md",
1617+
),
1618+
},
1619+
{
1620+
"name": "openeo-python-driver",
1621+
"version": importlib.metadata.version(distribution_name="openeo_driver"),
1622+
"changelog_path": openeo_driver.util.changelog.get_changelog_path(
1623+
data_files_dir="openeo-python-driver-data",
1624+
src_root=pathlib.Path(openeo_driver.__file__).parent.parent,
1625+
filename="CHANGELOG.md",
1626+
),
1627+
},
1628+
]
1629+
)
1630+
return flask.make_response(html, {"Content-Type": "text/html"})

0 commit comments

Comments
 (0)