Skip to content

Commit 5092b00

Browse files
author
a.pirogov
committed
feat: implement somesy fill command with Jinja templating (closes #42)
1 parent 9acacdf commit 5092b00

17 files changed

Lines changed: 226 additions & 52 deletions

.pre-commit-config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,16 @@ repos:
8282
- repo: local
8383
hooks:
8484
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
85-
- id: somesy
86-
name: somesy
85+
- id: somesy-sync
86+
name: Run somesy sync
8787
entry: somesy sync
8888
language: python
8989
files: '^\.somesy\.toml|pyproject\.toml$'
9090
pass_filenames: false
91+
92+
- id: somesy-fill
93+
name: Update AUTHORS.md
94+
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
95+
language: python
96+
files: '^\.somesy\.toml|pyproject\.toml$'
97+
pass_filenames: false

.pre-commit-hooks.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
- id: somesy
22
name: somesy
33
description: Sync your metadata files with somesy
4-
entry: somesy sync
4+
entry: somesy
5+
args: ["sync"]
56
language: python
67
files: '^somesy\.toml|\.somesy\.toml|pyproject\.toml|package\.json$'
78
pass_filenames: false

.somesy.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ given-names = "Mustafa"
1313
email = "m.soylu@fz-juelich.de"
1414
orcid = "https://orcid.org/0000-0003-2637-0432"
1515

16-
contribution = "The main developer, maintainer and tester."
16+
contribution = "Main developer, maintainer and tester."
1717
contribution_begin = "2023-03-01"
1818
contribution_types = ["maintenance", "code", "test", "review", "doc"]
1919

@@ -26,7 +26,7 @@ given-names = "Anton"
2626
email = "a.pirogov@fz-juelich.de"
2727
orcid = "https://orcid.org/0000-0002-5077-7497"
2828

29-
contribution = "Initial concepts, tool development and enhancement, documentation."
29+
contribution = "Concepts, tool development and enhancement, documentation."
3030
contribution_begin = "2023-03-01"
3131
contribution_types = ["ideas", "code", "test", "review", "doc"]
3232

AUTHORS.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
# Authors and Contributors
22

3-
**Main authors** are persons whose contributions significantly shaped
4-
the state of the software at some point in time.
3+
**Authors** are people whose contributions significantly shaped
4+
the state of `somesy` at some point in time.
55

6-
**Additional contributors** are persons who are not main authors,
7-
but contributed non-trivially to this project,
8-
e.g. by providing smaller fixes and enhancements to the code and/or documentation.
6+
**Additional contributors** are people who contributed non-trivially to this project
7+
in different ways, e.g. by providing smaller fixes and enhancements to the code
8+
and/or documentation.
99

1010
Of course, this is just a rough overview and categorization.
1111
For a more complete overview of all contributors and contributions,
1212
please inspect the git history of this repository.
1313

14-
## Main Authors
14+
## Authors
1515

1616
- Mustafa Soylu (
1717
[E-Mail](mailto:m.soylu@fz-juelich.de),
1818
[ORCID](https://orcid.org/0000-0003-2637-0432)
19-
): original author
20-
19+
): Main developer, maintainer and tester.
2120
- Anton Pirogov (
2221
[E-Mail](mailto:a.pirogov@fz-juelich.de),
2322
[ORCID](https://orcid.org/0000-0002-5077-7497)
24-
): documentation, review, and ideas
23+
): Concepts, tool development and enhancement, documentation.
2524

26-
## Additional Contributors
2725

28-
<!--
29-
- Name (E-mail, ORCID):
30-
Summary of contribution
31-
-->
26+
## Additional Contributors
3227

3328
- Jens Bröder (
3429
[E-Mail](mailto:j.broeder@fz-juelich.de),
3530
[ORCID](https://orcid.org/0000-0001-7939-226X)
36-
): ideas
37-
38-
... maybe **[you](https://materials-data-science-and-informatics.github.io/somesy/main/contributing)**?
31+
): Discussions and suggestions concerning metadata standards and usability.
32+
- Volker Hofmann (
33+
[E-Mail](mailto:v.hofmann@fz-juelich.de),
34+
[ORCID](https://orcid.org/0000-0002-5149-603X)
35+
): Discussions and suggestions concerning tool scope and usability.
36+
- Stefan Sandfeld (
37+
[E-Mail](mailto:s.sandfeld@fz-juelich.de),
38+
[ORCID](https://orcid.org/0000-0001-9560-4728)
39+
)
40+
41+
42+
... maybe **[you](https://materials-data-science-and-informatics.github.io/somesy/latest/contributing)**?

CITATION.cff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ authors:
1515
email: m.soylu@fz-juelich.de
1616
given-names: Mustafa
1717
family-names: Soylu
18-
- orcid: https://orcid.org/0000-0002-5077-7497
19-
email: a.pirogov@fz-juelich.de
20-
given-names: Anton
21-
family-names: Pirogov
2218
- email: v.hofmann@fz-juelich.de
2319
orcid: https://orcid.org/0000-0002-5149-603X
2420
family-names: Hofmann
@@ -27,6 +23,10 @@ authors:
2723
orcid: https://orcid.org/0000-0001-9560-4728
2824
family-names: Sandfeld
2925
given-names: Stefan
26+
- email: a.pirogov@fz-juelich.de
27+
orcid: https://orcid.org/0000-0002-5077-7497
28+
family-names: Pirogov
29+
given-names: Anton
3030
contact:
3131
- email: m.soylu@fz-juelich.de
3232
family-names: Soylu

codemeta.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@
1111
"audience": [
1212
{
1313
"@type": "Audience",
14-
"audienceType": "Developers"
14+
"audienceType": "Science/Research"
1515
},
1616
{
1717
"@type": "Audience",
18-
"audienceType": "Science/Research"
18+
"audienceType": "Developers"
1919
}
2020
],
2121
"author": [
22+
{
23+
"@id": "https://orcid.org/0000-0003-2637-0432",
24+
"@type": "Person",
25+
"familyName": "Soylu",
26+
"givenName": "Mustafa"
27+
},
2228
{
2329
"@id": "https://orcid.org/0000-0002-5149-603X",
2430
"@type": "Person",
@@ -31,12 +37,6 @@
3137
"familyName": "Sandfeld",
3238
"givenName": "Stefan"
3339
},
34-
{
35-
"@id": "https://orcid.org/0000-0003-2637-0432",
36-
"@type": "Person",
37-
"familyName": "Soylu",
38-
"givenName": "Mustafa"
39-
},
4040
{
4141
"@id": "https://orcid.org/0000-0002-5077-7497",
4242
"@type": "Person",
@@ -91,6 +91,13 @@
9191
"runtimePlatform": "Python 3",
9292
"version": "^4.11.0"
9393
},
94+
{
95+
"@type": "SoftwareApplication",
96+
"identifier": "jinja2",
97+
"name": "jinja2",
98+
"runtimePlatform": "Python 3",
99+
"version": "^3.1.2"
100+
},
94101
{
95102
"@type": "SoftwareApplication",
96103
"identifier": "packaging",

docs/_template_authors.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Authors and Contributors
2+
3+
**Authors** are people whose contributions significantly shaped
4+
the state of `{{ project.name }}` at some point in time.
5+
6+
**Additional contributors** are people who contributed non-trivially to this project
7+
in different ways, e.g. by providing smaller fixes and enhancements to the code
8+
and/or documentation.
9+
10+
Of course, this is just a rough overview and categorization.
11+
For a more complete overview of all contributors and contributions,
12+
please inspect the git history of this repository.
13+
14+
## Authors
15+
16+
{% for p in project.authors() %}
17+
{%- set contr_desc = p.contribution or "" -%}
18+
- {{ p.full_name }} (
19+
[E-Mail](mailto:{{ p.email }}),
20+
[ORCID]({{ p.orcid }})
21+
){{ ": "+contr_desc if contr_desc else "" }}
22+
{% endfor %}
23+
24+
## Additional Contributors
25+
26+
{% for p in project.contributors() %}
27+
{%- set contr_desc = p.contribution or "" -%}
28+
- {{ p.full_name }} (
29+
[E-Mail](mailto:{{ p.email }}),
30+
[ORCID]({{ p.orcid }})
31+
){{ ": "+contr_desc if contr_desc else "" }}
32+
{% endfor %}
33+
34+
... maybe **[you](https://materials-data-science-and-informatics.github.io/somesy/latest/contributing)**?
35+

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ plugins:
143143
enabled: !ENV [OFFLINE, false]
144144
# to make multi-version docs work right
145145
- mike
146+
- exclude:
147+
glob:
148+
- "_*.md" # for internal purposes
146149

147150
hooks:
148151
- docs/scripts/coverage_status.py

poetry.lock

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ wrapt = "^1.15.0"
4545
packaging = "^23.1"
4646
rdflib = "^6.3.2"
4747
codemetapy = "^2.5.0"
48+
jinja2 = "^3.1.2"
4849

4950
[tool.poetry.group.dev.dependencies]
5051
poethepoet = "^0.18.1"
@@ -76,6 +77,7 @@ mike = "^1.1.2"
7677
anybadge = "^1.14.0"
7778
interrogate = "^1.5.0"
7879
black = "^23.3.0"
80+
mkdocs-exclude = "^1.0.2"
7981

8082
[tool.poetry.scripts]
8183
somesy = "somesy.main:app"
@@ -99,9 +101,10 @@ licensecheck = "licensecheck" # run this when you add new deps
99101
pythonpath = ["src"]
100102
addopts = "--cov-report=term-missing:skip-covered"
101103
filterwarnings = [
102-
"ignore::DeprecationWarning:pkg_resources.*"
104+
"ignore::DeprecationWarning:pkg_resources.*",
105+
"ignore::DeprecationWarning:pyshacl.*",
103106
# Example:
104-
# "ignore::DeprecationWarning:importlib_metadata.*"
107+
# "ignore::DeprecationWarning:importlib_metadata.*",
105108
]
106109

107110
[tool.coverage.run]

0 commit comments

Comments
 (0)