Skip to content

Commit

Permalink
Merge pull request #82 from Materials-Data-Science-and-Informatics/fi…
Browse files Browse the repository at this point in the history
…x/required_fields

Fix/required fields
  • Loading branch information
mustafasoylu committed Apr 8, 2024
2 parents 16dfb47 + 8be7dd2 commit 77c9345
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .somesy.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "somesy"
version = "0.4.0"
version = "0.4.1"
description = "A CLI tool for synchronizing software project metadata."
keywords = ["metadata", "FAIR"]
license = "MIT"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Here we provide notes that summarize the most important changes in each released

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

## [v0.4.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.1) <small>(2024-02-??)</small> { id="0.4.1" }

* fix package.json and mkdocs.yml validation bug about optional fields

## [v0.4.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.0) <small>(2024-02-??)</small> { id="0.4.0" }

* added separate `documentation` URL to Project metadata model
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: software
message: If you use this software, please cite it using this metadata.

title: somesy
version: 0.4.0
version: 0.4.1
abstract: A CLI tool for synchronizing software project metadata.
url: https://materials-data-science-and-informatics.github.io/somesy
repository-code: https://github.com/Materials-Data-Science-and-Informatics/somesy
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
],
"name": "somesy",
"description": "A CLI tool for synchronizing software project metadata.",
"version": "0.4.0",
"version": "0.4.1",
"keywords": [
"metadata",
"FAIR"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "somesy"
version = "0.4.0"
version = "0.4.1"
description = "A CLI tool for synchronizing software project metadata."
authors = ["Mustafa Soylu <m.soylu@fz-juelich.de>", "Anton Pirogov <a.pirogov@fz-juelich.de>"]
maintainers = ["Mustafa Soylu <m.soylu@fz-juelich.de>"]
Expand Down
8 changes: 5 additions & 3 deletions src/somesy/mkdocs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ class MkDocsConfig(BaseModel):
str,
Field(pattern=r"^[A-Za-z0-9]+([_-][A-Za-z0-9]+)*$", description="Site name"),
]
site_description: Annotated[str, Field(description="Site description")] = None
site_author: Annotated[str, Field(description="Site authors")] = None
site_description: Annotated[
Optional[str], Field(description="Site description")
] = None
site_author: Annotated[Optional[str], Field(description="Site authors")] = None
site_url: Annotated[Optional[HttpUrlStr], Field(description="Site homepage")] = None
repo_url: Annotated[
Optional[HttpUrlStr], Field(description="Package repository")
] = None
repo_name: Annotated[str, Field(description="Repository name")] = None
repo_name: Annotated[Optional[str], Field(description="Repository name")] = None
18 changes: 10 additions & 8 deletions src/somesy/package_json/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ class PackageAuthor(BaseModel):
"""Package author model."""

name: Annotated[Optional[str], Field(description="Author name")]
email: Annotated[Optional[EmailStr], Field(description="Author email")]
email: Annotated[Optional[EmailStr], Field(description="Author email")] = None
url: Annotated[
Optional[HttpUrlStr], Field(description="Author website or orcid page")
]
] = None


class PackageRepository(BaseModel):
"""Package repository model."""

type: Annotated[Optional[str], Field(description="Repository type")]
type: Annotated[Optional[str], Field(description="Repository type")] = None
url: Annotated[str, Field(description="Repository url")]


class PackageLicense(BaseModel):
"""Package license model."""

type: Annotated[Optional[str], Field(description="License type")]
type: Annotated[Optional[str], Field(description="License type")] = None
url: Annotated[str, Field(description="License url")]


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

name: Annotated[str, Field(description="Package name")]
version: Annotated[str, Field(description="Package version")]
description: Annotated[Optional[str], Field(description="Package description")]
description: Annotated[
Optional[str], Field(description="Package description")
] = None
author: Annotated[
Optional[Union[str, PackageAuthor]], Field(description="Package author")
]
] = None
maintainers: Annotated[
Optional[List[Union[str, PackageAuthor]]],
Field(description="Package maintainers"),
Expand All @@ -58,10 +60,10 @@ class PackageJsonConfig(BaseModel):
] = None
license: Annotated[
Optional[Union[str, PackageLicense]], Field(description="Package license")
]
] = None
repository: Annotated[
Optional[Union[PackageRepository, str]], Field(description="Package repository")
]
] = None
homepage: Annotated[
Optional[HttpUrlStr], Field(description="Package homepage")
] = None
Expand Down

0 comments on commit 77c9345

Please sign in to comment.