|
4 | 4 | import dataclasses
|
5 | 5 | import datetime
|
6 | 6 | import functools
|
| 7 | +import importlib |
| 8 | +import importlib.metadata |
7 | 9 | import logging
|
8 | 10 | import pathlib
|
9 | 11 | import re
|
|
27 | 29 | import openeo
|
28 | 30 | import openeo.rest
|
29 | 31 | import openeo_driver.errors
|
| 32 | +import openeo_driver.util.changelog |
30 | 33 | import openeo_driver.util.view_helpers
|
31 | 34 | from openeo.capabilities import ComparableVersion
|
32 | 35 | from openeo.rest import (
|
@@ -1601,9 +1604,27 @@ def postprocess_capabilities(self, capabilities: dict) -> dict:
|
1601 | 1604 | capabilities["_partitioned_job_tracking"] = bool(self.batch_jobs.partitioned_job_tracker)
|
1602 | 1605 | return capabilities
|
1603 | 1606 |
|
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