Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit b294b8c
Author: Mustafa SOYLU <[email protected]>
Date:   Wed Jan 15 10:55:45 2025 +0100

    bump version to 0.5.0 (#103)

commit 9c87008
Author: Mustafa SOYLU <[email protected]>
Date:   Wed Jan 15 10:41:47 2025 +0100

    update documentation (#94)

    * add notes

    * explain why set some fields as compulsory

    * Update README.md

    Co-authored-by: Volker Hofmann <[email protected]>

    ---------

    Co-authored-by: Volker Hofmann <[email protected]>

commit 42ae9c2
Author: Mustafa SOYLU <[email protected]>
Date:   Wed Jan 15 10:41:23 2025 +0100

    Optional email (#102)

    * make email optional in the person model

    * remove none's from the existing people list

    * make email optional in setuptools model

    * remove check of no email value since it is done in core now

    * update tests for optional email

    * show email is optional in manual

    * update doc dev docs for ruff usage

commit d28180d
Author: Mustafa Soylu <[email protected]>
Date:   Mon Jul 29 09:47:48 2024 +0200

    fix version in readme

commit 26dc24a
Merge: f42047b f53acd6
Author: Mustafa SOYLU <[email protected]>
Date:   Mon Jul 29 09:34:36 2024 +0200

    Merge pull request #93 from Materials-Data-Science-and-Informatics/release/v0.4.3

    v0.4.3

commit f53acd6
Author: Mustafa Soylu <[email protected]>
Date:   Mon Jul 29 09:25:27 2024 +0200

    update changelog and metadata

commit f42047b
Merge: a1548c9 78f8dc6
Author: Mustafa SOYLU <[email protected]>
Date:   Fri Jul 26 15:15:20 2024 +0200

    Merge pull request #92 from Materials-Data-Science-and-Informatics/fix/validations

    update/fix validations

commit 78f8dc6
Author: Mustafa Soylu <[email protected]>
Date:   Fri Jul 26 14:31:18 2024 +0200

    fix test since person conversion fails returns none on error

commit 4c81e63
Author: Mustafa Soylu <[email protected]>
Date:   Fri Jul 26 14:30:58 2024 +0200

    check if person if None on the base class

commit 993b714
Author: Mustafa Soylu <[email protected]>
Date:   Fri Jul 26 14:30:37 2024 +0200

    return None if person conversion fails

commit 188eda1
Author: Mustafa Soylu <[email protected]>
Date:   Tue Jul 23 16:01:51 2024 +0200

    update changelog

commit 023c33b
Author: Mustafa Soylu <[email protected]>
Date:   Tue Jul 23 16:01:33 2024 +0200

    add missing error type

commit acd3dab
Author: Mustafa Soylu <[email protected]>
Date:   Tue Jul 23 16:01:18 2024 +0200

    disable error raise on users without email in julia

commit 32ad110
Author: Mustafa Soylu <[email protected]>
Date:   Tue Jul 23 16:01:03 2024 +0200

    disable error raise on users without email in package.json

commit a400d97
Author: Mustafa Soylu <[email protected]>
Date:   Tue Jul 23 16:00:19 2024 +0200

    disable error raise on users without email in poetry

commit a1548c9
Merge: 6257f3a 324b4c3
Author: Mustafa SOYLU <[email protected]>
Date:   Tue Jul 23 11:55:24 2024 +0200

    Merge pull request #91 from Materials-Data-Science-and-Informatics/feature/update_hooks

    update pre-commit hooks and dependencies

commit 324b4c3
Author: Mustafa Soylu <[email protected]>
Date:   Tue Jul 23 11:41:52 2024 +0200

    update dependencies

commit 4bc902d
Author: Mustafa Soylu <[email protected]>
Date:   Tue Jul 23 11:25:29 2024 +0200

    update pre-commit hooks

commit 6257f3a
Merge: 77c9345 0972820
Author: Mustafa SOYLU <[email protected]>
Date:   Tue Apr 30 11:39:15 2024 +0200

    Merge pull request #86 from Materials-Data-Science-and-Informatics/fix/log_format

    Fix/log format

commit 0972820
Author: Mustafa Soylu <[email protected]>
Date:   Tue Apr 30 11:35:01 2024 +0200

    bump version to 0.4.2

commit f02d8cf
Author: Mustafa Soylu <[email protected]>
Date:   Tue Apr 30 11:29:25 2024 +0200

    fix rich formating of error message and traceback

commit 77c9345
Merge: 16dfb47 8be7dd2
Author: Mustafa SOYLU <[email protected]>
Date:   Mon Apr 8 17:54:07 2024 +0200

    Merge pull request #82 from Materials-Data-Science-and-Informatics/fix/required_fields

    Fix/required fields

commit 8be7dd2
Author: Mustafa Soylu <[email protected]>
Date:   Mon Apr 8 14:13:58 2024 +0200

    bump version to 0.4.1

commit f48f5d3
Author: Mustafa Soylu <[email protected]>
Date:   Mon Apr 8 11:38:54 2024 +0200

    fix package license

commit 7bb381c
Author: Mustafa Soylu <[email protected]>
Date:   Mon Apr 8 11:33:37 2024 +0200

    fix mkdocs optional fields

commit c9d2179
Author: Mustafa Soylu <[email protected]>
Date:   Mon Apr 8 11:33:21 2024 +0200

    fix package json optional fields
  • Loading branch information
mustafasoylu committed Feb 5, 2025
1 parent bb07485 commit 96b230b
Show file tree
Hide file tree
Showing 55 changed files with 1,418 additions and 907 deletions.
128 changes: 64 additions & 64 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
repos:
# Various general + format-specific helpers
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-symlinks
- id: trailing-whitespace
#- id: mixed-line-ending
# args: [--fix=lf]
- id: check-yaml
exclude: "mkdocs.yml"
- id: check-toml
- id: check-json
- id: check-ast
- id: debug-statements
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-added-large-files
args: [--maxkb=10000]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.22.0"
hooks:
- id: check-github-workflows
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.6
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.1.1"
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
# NOTE: you might need to add some deps here:
additional_dependencies: []
# Various general + format-specific helpers
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-symlinks
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
- id: check-yaml
exclude: 'mkdocs.yml'
- id: check-toml
- id: check-json
- id: check-ast
- id: debug-statements
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-added-large-files
args: [--maxkb=10000]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: '0.29.0'
hooks:
- id: check-github-workflows
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.4
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.0'
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
# NOTE: you might need to add some deps here:
additional_dependencies: []

# Metadata
- repo: https://github.com/citation-file-format/cff-converter-python
rev: "44e8fc9"
hooks:
- id: validate-cff
- repo: https://github.com/fsfe/reuse-tool
rev: "v1.1.2"
hooks:
- id: reuse
# Metadata
- repo: https://github.com/citation-file-format/cff-converter-python
rev: '054bda51dbe278b3e86f27c890e3f3ac877d616c'
hooks:
- id: validate-cff
- repo: https://github.com/fsfe/reuse-tool
rev: 'v4.0.3'
hooks:
- id: reuse

- repo: local
hooks:
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
- id: somesy-sync
name: Run somesy sync
entry: somesy sync
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false
- repo: local
hooks:
# NOTE: copy from .pre-commit-hooks.yaml, for technical reasons
- id: somesy-sync
name: Run somesy sync
entry: somesy sync
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false

- id: somesy-fill
name: Update AUTHORS.md
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false
- id: somesy-fill
name: Update AUTHORS.md
entry: somesy fill -t docs/_template_authors.md -o AUTHORS.md
language: python
files: '^\.somesy\.toml|pyproject\.toml$'
pass_filenames: false
3 changes: 2 additions & 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.5.0"
description = "A CLI tool for synchronizing software project metadata."
keywords = ["metadata", "FAIR"]
license = "MIT"
Expand Down Expand Up @@ -29,6 +29,7 @@ orcid = "https://orcid.org/0000-0002-5077-7497"

contribution = "Concepts, tool development and enhancement, documentation."
contribution_begin = "2023-03-01"
contribution_end = "2023-04-30"
contribution_types = ["ideas", "code", "test", "review", "doc"]

author = true
Expand Down
51 changes: 35 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,54 @@ 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.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.0) <small>(2024-02-??)</small> { id="0.4.0" }
## [v0.5.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.3) <small>(2025-01-15)</small> { id="0.5.0" }

* added separate `documentation` URL to Project metadata model
* added support for Julia `Project.toml` file
* added support for Fortran `fpm.toml` file
* added support for Java `pom.xml` file
* added support for MkDocs `mkdocs.yml` file
* added support for Rust `Cargo.toml` file
- make person argument email optional

## [v0.4.3](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.3) <small>(2024-07-29)</small> { id="0.4.3" }

- update python dependencies
- update pre-commit hook versions
- fix package.json person validation
- update poetry, julia, and package.json person validation: entries without an email wont't raise an error, they will be ignored.

## [v0.4.2](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.2) <small>(2024-04-30)</small> { id="0.4.2" }

- fix rich logging bug for error messages and tracebacks

## [v0.4.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.4.1) <small>(2024-04-08)</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-03-08)</small> { id="0.4.0" }

- added separate `documentation` URL to Project metadata model
- added support for Julia `Project.toml` file
- added support for Fortran `fpm.toml` file
- added support for Java `pom.xml` file
- added support for MkDocs `mkdocs.yml` file
- added support for Rust `Cargo.toml` file

## [v0.3.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.3.1) <small>(2024-01-23)</small> { id="0.3.1" }

* fix setuptools license writing bug
- fix setuptools license writing bug

## [v0.3.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.3.0) <small>(2024-01-12)</small> { id="0.3.0" }

* replace codemetapy with an in-house writer, which enables windows support
- replace codemetapy with an in-house writer, which enables windows support

## [v0.2.1](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.2.1) <small>(2023-11-29)</small> { id="0.2.1" }

* **internal:** updated linters and dependencies
* **internal:** pin codemetapy version to 2.5.2 to avoid breaking changes
* fix bug caused by missing `config` section
- **internal:** updated linters and dependencies
- **internal:** pin codemetapy version to 2.5.2 to avoid breaking changes
- fix bug caused by missing `config` section

## [v0.2.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.2.0) <small>(2023-11-29)</small> { id="0.2.0" }

* **internal:** Test refactoring
* **internal:** Pydantic 2 implementation
* Added `publication_author` field to Person model
- **internal:** Test refactoring
- **internal:** Pydantic 2 implementation
- Added `publication_author` field to Person model

## [v0.1.0](https://github.com/Materials-Data-Science-and-Informatics/somesy/tree/v0.1.0) <small>(2023-08-10)</small> { id="0.1.0" }

* First release
- First release
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.5.0
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
70 changes: 40 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<img alt="HMC Logo" src="https://github.com/Materials-Data-Science-and-Informatics/Logos/raw/main/Somesy/Somesy_Logo_Text.png" style="width: 50%; height: 50%;" />
</div>


# somesy

Somesy (**so**ftware **me**tadata **sy**nc) is a CLI tool to avoid messy software project metadata by keeping it in sync.
Expand Down Expand Up @@ -66,15 +65,20 @@ latest stable version of somesy from PyPI using `pip`:
pip install somesy
```

> **Note**
>
> If you use somesy as a pre-commit hook, you don't have to install somesy on your PC nor add it as a dependency in your Python project. Pre-commit will handle the installation automatically.
### Configuring somesy

Yes, somesy is *another* tool with its own configuration. However, for your
Yes, somesy is _another_ tool with its own configuration. However, for your
project metadata it is hopefully the last file you need, and the only one you
have to think about, `somesy` will take care of the others for you!

To get started, create a file named `somesy.toml`:

<!-- --8<-- [start:somesytoml] -->

```toml
[project]
name = "my-amazing-project"
Expand Down Expand Up @@ -106,6 +110,9 @@ publication_author = true
[config]
verbose = true # show detailed information about what somesy is doing
```

As Helmholtz Metadata Collaboration (HMC), our goal is to increase usage of metadata and improve metadata quality. Therefore, some fields in `somesy.toml` are set as required fields. This is to increase rigour and completeness of metadata recorded with `somesy` .

<!-- --8<-- [end:somesytoml] -->

Alternatively, you can also add the somesy configuration to an existing
Expand All @@ -122,19 +129,19 @@ somesy sync

The information in your `somesy.toml` is used as the **primary and
authoritative** source for project metadata, which is used to update all
supported (and enabled) *target files*. You can find an overview of supported
supported (and enabled) _target files_. You can find an overview of supported
formats further below.

By default, `somesy` will create (if they did not exist) or update `CITATION.cff` and `codemeta.json` files in your repository.
If you happen to use

* `pyproject.toml` (in Python projects),
* `package.json` (in JavaScript projects),
* `Project.toml` (in Julia projects),
* `fpm.toml` (in Fortran projects),
* `pom.xml` (in Java projects),
* `mkdocs.yml` (in projects using MkDocs),
* `Cargo.toml` (in Rust projects)
- `pyproject.toml` (in Python projects),
- `package.json` (in JavaScript projects),
- `Project.toml` (in Julia projects),
- `fpm.toml` (in Fortran projects),
- `pom.xml` (in Java projects),
- `mkdocs.yml` (in projects using MkDocs),
- `Cargo.toml` (in Rust projects)

then somesy would also update the respective information there.

Expand All @@ -158,44 +165,48 @@ file in the root folder of your repository:
repos:
# ... (your other hooks) ...
- repo: https://github.com/Materials-Data-Science-and-Informatics/somesy
rev: "v0.3.0"
rev: "v0.5.0"
hooks:
- id: somesy
```
> **Note**
>
> Please add the latest version of Somesy to your project. You can update the version of Somesy in your config file now and later to use the newest versions as they become available.
Note that `pre-commit` gives `somesy` the [staged](https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F) version of files,
so when using `somesy` with pre-commit, keep in mind that

* if `somesy` changed some files, you need to `git add` them again (and rerun pre-commit)
* if you explicitly run `pre-commit`, make sure to `git add` all changed files (just like before a commit)
- if `somesy` changed some files, you need to `git add` them again (and rerun pre-commit)
- if you explicitly run `pre-commit`, make sure to `git add` all changed files (just like before a commit)

<!-- --8<-- [end:precommit] -->

## Supported File Formats

Here is an overview of all the currently supported files and formats.

| Input Formats | Status | | Target Formats | Status |
| -------------- | ------ |-| ----------------------------- | ------ |
| (.)somesy.toml | ✓ | | pyproject.toml _(poetry)_ | ✓ |
| pyproject.toml | ✓ | | pyproject.toml _(setuptools)_ | ✓(1.) |
| package.json | ✓ | | package.json _(JavaScript)_ | ✓(2.) |
| Project.toml | ✓ | | Project.toml _(Julia)_ | ✓ |
| fpm.toml | ✓ | | fpm.toml _(Fortran)_ | ✓(3.) |
| | ✓ | | pom.toml _(Java)_ | ✓(4.) |
| Cargo.toml | ✓ | | Cargo.toml _(Rust)_ | ✓ |
| | | | mkdocs.yml | ✓(5.) |
| | | | CITATION.cff | ✓ |
| | | | codemeta.json | ✓(6.) |
| Input Formats | Status | | Target Formats | Status |
| -------------- | ------ | --- | ----------------------------- | ------ |
| (.)somesy.toml | ✓ | | pyproject.toml _(poetry)_ | ✓ |
| pyproject.toml | ✓ | | pyproject.toml _(setuptools)_ | ✓(1.) |
| package.json | ✓ | | package.json _(JavaScript)_ | ✓(2.) |
| Project.toml | ✓ | | Project.toml _(Julia)_ | ✓ |
| fpm.toml | ✓ | | fpm.toml _(Fortran)_ | ✓(3.) |
| | ✓ | | pom.toml _(Java)_ | ✓(4.) |
| Cargo.toml | ✓ | | Cargo.toml _(Rust)_ | ✓ |
| | | | mkdocs.yml | ✓(5.) |
| | | | CITATION.cff | ✓ |
| | | | codemeta.json | ✓(6.) |

**Notes:**

1. note that `somesy` does not support setuptools *dynamic fields*
2. `package.json` only supports one author, so `somesy` will pick the *first* listed author
3. `fpm.toml` only supports one author and maintainer, so `somesy` will pick the *first* listed author and maintainer
1. note that `somesy` does not support setuptools _dynamic fields_
2. `package.json` only supports one author, so `somesy` will pick the _first_ listed author
3. `fpm.toml` only supports one author and maintainer, so `somesy` will pick the _first_ listed author and maintainer
4. `pom.xml` has no concept of `maintainers`, but it can have multiple licenses (somesy only supports one main project license)
5. `mkdocs.yml` is a bit special, as it is not a project file, but a documentation file. `somesy` will only update it if it exists and is enabled in the configuration
6. unlike other targets, `somesy` will *re-create* the `codemeta.json` (i.e. do not edit it by hand!)
6. unlike other targets, `somesy` will _re-create_ the `codemeta.json` (i.e. do not edit it by hand!)

<!-- --8<-- [end:quickstart] -->

Expand All @@ -215,7 +226,6 @@ in the [repository](https://github.com/Materials-Data-Science-and-Informatics/so
We kindly thank all
[authors and contributors](https://materials-data-science-and-informatics.github.io/somesy/latest/credits).


<div>
<img style="vertical-align: middle;" alt="HMC Logo" src="https://github.com/Materials-Data-Science-and-Informatics/Logos/raw/main/HMC/HMC_Logo_M.png" width=50% height=50% />
&nbsp;&nbsp;
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.5.0",
"keywords": [
"metadata",
"FAIR"
Expand Down
4 changes: 1 addition & 3 deletions docs/dev_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ Best practices for modern Python development are implemented by using:
* `pytest` for unit testing
* `hypothesis` for property-based testing
* `pre-commit` for orchestrating linters, formatters and other utilities
* `black` for source-code formatting
* `autoflake` for automatically removing unused imports
* `flake8` for general linting (using various linter plugins)
* `ruff` for source-code formatting and for general linting
* `pydocstyle` for checking docstring conventions
* `interrogate` for computing docstring coverage
* `mypy` for editor-independent type-checking
Expand Down
Loading

0 comments on commit 96b230b

Please sign in to comment.