Skip to content

Commit 224d5b7

Browse files
authored
Merge pull request #479 from softwarepub/refactor/423-implement-public-api
Refactor/423 implement public api
2 parents 4887eae + 5108696 commit 224d5b7

56 files changed

Lines changed: 4873 additions & 1068 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-FileCopyrightText: 2026 German Aerospace Center (DLR)
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# SPDX-FileContributor: Michael Fritzsche
6+
7+
# add option to pass zenodo sandbox auth token to pytest to run ./test/hermes_test/commands/deposit/test_invenio_e2e.py
8+
def pytest_addoption(parser):
9+
parser.addoption("--sandbox_auth", action="store", default=None)

docs/source/_static/custom.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/*
88
* SPDX-FileContributor: Oliver Bertuch
9+
* SPDX-FileContributor: Michael Fritzsche
910
*/
1011

1112
img.member {
@@ -22,4 +23,36 @@ img.badge-icon {
2223
img.member {
2324
max-width: 23%;
2425
}
26+
}
27+
28+
img {
29+
display: block;
30+
margin: auto;
31+
}
32+
33+
.bd-page-width {
34+
max-width: none !important;
35+
}
36+
37+
@media (min-width: 1200px) {
38+
.bd-article-container {
39+
max-width: none !important;
40+
}
41+
}
42+
43+
.bd-article-container {
44+
max-width: 100%;
45+
}
46+
47+
.bd-sidebar-primary.bd-sidebar {
48+
max-width: min-content;
49+
}
50+
51+
.bd-docs-nav {
52+
min-width: max-content;
53+
}
54+
55+
.bd-sidebar-secondary{
56+
max-width: 15%;
57+
width: max-content;
2558
}

docs/source/conf.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def read_from_pyproject(file_path="../../pyproject.toml"):
3939
data = toml.load(file_path)
4040

4141
# Navigate to the authors metadata
42-
metadata = data.get("tool", {}).get("poetry", {})
42+
metadata = data.get("project", {})
4343
if not metadata:
4444
return "No metadata found in pyproject.toml"
4545
return metadata
@@ -56,7 +56,7 @@ def read_authors_from_pyproject():
5656
if not authors:
5757
return "No authors metadata found in pyproject.toml"
5858
# Convert the list of authors to a comma-separated string
59-
return ", ".join([a.split(" <")[0] for a in authors])
59+
return ", ".join([author["name"] for author in authors])
6060

6161
def read_version_from_pyproject():
6262
metadata = read_from_pyproject()
@@ -73,7 +73,7 @@ def read_version_from_pyproject():
7373
author = read_authors_from_pyproject()
7474

7575
# The full version, including alpha/beta/rc tags
76-
release = read_version_from_pyproject()
76+
version = release = read_version_from_pyproject()
7777

7878

7979
# -- General configuration ---------------------------------------------------
@@ -102,7 +102,7 @@ def read_version_from_pyproject():
102102
'sphinx_togglebutton',
103103
'sphinxcontrib.datatemplates',
104104
# Custom extensions, see `_ext` directory.
105-
# 'plugin_markup',
105+
'plugin_markup',
106106
]
107107

108108
language = 'en'
@@ -131,6 +131,9 @@ def read_version_from_pyproject():
131131
autoapi_dirs = ["../../src"]
132132
autoapi_root = "api"
133133
autoapi_ignore = ["*__main__*"]
134+
autoapi_options = [
135+
"members", "undoc-members", "private-members", "special-members", "show-inheritance", "show-module-summary"
136+
]
134137

135138
# -- Options for HTML output -------------------------------------------------
136139

@@ -161,6 +164,7 @@ def read_version_from_pyproject():
161164
"repository_url": "https://github.com/hermes-hmc/hermes",
162165
"use_repository_button": True,
163166
"navigation_with_keys": False,
167+
"max_navbar_depth": -1
164168
}
165169

166170
html_css_files = [
@@ -182,3 +186,20 @@ def read_version_from_pyproject():
182186
# -- Options for sphinx-togglebutton -----------------------------------------
183187

184188
togglebutton_hint = "Click to show screenshot"
189+
190+
191+
# TODO: remove this workaround and remove "undoc-members" from autoapi_options once everything is documented
192+
# This removes all generated entries for known documented classes (because autoapi will add all attributes
193+
# it finds in the code no matter if they are described in a class doc string or not).
194+
def autoapi_skip_member(app, obj_type, name, obj, skip, options):
195+
if obj_type == "attribute":
196+
if any(documented_type in obj.id for documented_type in [
197+
"Collect", "HermesCache", "HermesContext", "HermesMergeError", "ld_container", "ld_context", "ld_dict",
198+
"ld_list", "ld_merge_dict", "ld_merge_list", "MergeSet"
199+
]):
200+
return True
201+
202+
return skip
203+
204+
def setup(app):
205+
app.connect("autoapi-skip-member", autoapi_skip_member)

docs/source/tutorials/automated-publication-with-ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Each step in the publication workflow has its own section.
110110

111111
Configure HERMES to:
112112

113-
- harvest metadata from Git and `CITATION.cff`
113+
- harvest metadata from `CITATION.cff`
114114
- deposit on Zenodo Sandbox (which is built on the InvenioRDM)
115115
- use Zenodo Sandbox as the target publication repository
116116

0 commit comments

Comments
 (0)