Skip to content

Commit 77c9345

Browse files
authored
Merge pull request #82 from Materials-Data-Science-and-Informatics/fix/required_fields
Fix/required fields
2 parents 16dfb47 + 8be7dd2 commit 77c9345

7 files changed

Lines changed: 23 additions & 15 deletions

File tree

.somesy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "somesy"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "A CLI tool for synchronizing software project metadata."
55
keywords = ["metadata", "FAIR"]
66
license = "MIT"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Here we provide notes that summarize the most important changes in each released
44

55
Please consult the changelog to inform yourself about breaking changes and security issues.
66

7+
## [v0.4.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.1) <small>(2024-02-??)</small> { id="0.4.1" }
8+
9+
* fix package.json and mkdocs.yml validation bug about optional fields
10+
711
## [v0.4.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.0) <small>(2024-02-??)</small> { id="0.4.0" }
812

913
* added separate `documentation` URL to Project metadata model

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type: software
33
message: If you use this software, please cite it using this metadata.
44

55
title: somesy
6-
version: 0.4.0
6+
version: 0.4.1
77
abstract: A CLI tool for synchronizing software project metadata.
88
url: https://materials-data-science-and-informatics.github.io/somesy
99
repository-code: https://github.com/Materials-Data-Science-and-Informatics/somesy

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626
"name": "somesy",
2727
"description": "A CLI tool for synchronizing software project metadata.",
28-
"version": "0.4.0",
28+
"version": "0.4.1",
2929
"keywords": [
3030
"metadata",
3131
"FAIR"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "somesy"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "A CLI tool for synchronizing software project metadata."
55
authors = ["Mustafa Soylu <m.soylu@fz-juelich.de>", "Anton Pirogov <a.pirogov@fz-juelich.de>"]
66
maintainers = ["Mustafa Soylu <m.soylu@fz-juelich.de>"]

src/somesy/mkdocs/models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ class MkDocsConfig(BaseModel):
1919
str,
2020
Field(pattern=r"^[A-Za-z0-9]+([_-][A-Za-z0-9]+)*$", description="Site name"),
2121
]
22-
site_description: Annotated[str, Field(description="Site description")] = None
23-
site_author: Annotated[str, Field(description="Site authors")] = None
22+
site_description: Annotated[
23+
Optional[str], Field(description="Site description")
24+
] = None
25+
site_author: Annotated[Optional[str], Field(description="Site authors")] = None
2426
site_url: Annotated[Optional[HttpUrlStr], Field(description="Site homepage")] = None
2527
repo_url: Annotated[
2628
Optional[HttpUrlStr], Field(description="Package repository")
2729
] = None
28-
repo_name: Annotated[str, Field(description="Repository name")] = None
30+
repo_name: Annotated[Optional[str], Field(description="Repository name")] = None

src/somesy/package_json/models.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ class PackageAuthor(BaseModel):
1212
"""Package author model."""
1313

1414
name: Annotated[Optional[str], Field(description="Author name")]
15-
email: Annotated[Optional[EmailStr], Field(description="Author email")]
15+
email: Annotated[Optional[EmailStr], Field(description="Author email")] = None
1616
url: Annotated[
1717
Optional[HttpUrlStr], Field(description="Author website or orcid page")
18-
]
18+
] = None
1919

2020

2121
class PackageRepository(BaseModel):
2222
"""Package repository model."""
2323

24-
type: Annotated[Optional[str], Field(description="Repository type")]
24+
type: Annotated[Optional[str], Field(description="Repository type")] = None
2525
url: Annotated[str, Field(description="Repository url")]
2626

2727

2828
class PackageLicense(BaseModel):
2929
"""Package license model."""
3030

31-
type: Annotated[Optional[str], Field(description="License type")]
31+
type: Annotated[Optional[str], Field(description="License type")] = None
3232
url: Annotated[str, Field(description="License url")]
3333

3434

@@ -44,10 +44,12 @@ class PackageJsonConfig(BaseModel):
4444

4545
name: Annotated[str, Field(description="Package name")]
4646
version: Annotated[str, Field(description="Package version")]
47-
description: Annotated[Optional[str], Field(description="Package description")]
47+
description: Annotated[
48+
Optional[str], Field(description="Package description")
49+
] = None
4850
author: Annotated[
4951
Optional[Union[str, PackageAuthor]], Field(description="Package author")
50-
]
52+
] = None
5153
maintainers: Annotated[
5254
Optional[List[Union[str, PackageAuthor]]],
5355
Field(description="Package maintainers"),
@@ -58,10 +60,10 @@ class PackageJsonConfig(BaseModel):
5860
] = None
5961
license: Annotated[
6062
Optional[Union[str, PackageLicense]], Field(description="Package license")
61-
]
63+
] = None
6264
repository: Annotated[
6365
Optional[Union[PackageRepository, str]], Field(description="Package repository")
64-
]
66+
] = None
6567
homepage: Annotated[
6668
Optional[HttpUrlStr], Field(description="Package homepage")
6769
] = None

0 commit comments

Comments
 (0)