Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom License Text #650

Open
mese79 opened this issue Nov 11, 2024 · 4 comments
Open

Custom License Text #650

mese79 opened this issue Nov 11, 2024 · 4 comments

Comments

@mese79
Copy link
Contributor

mese79 commented Nov 11, 2024

While most of the time using just SPDX license identifier would be enough for model uploaders, sometimes a model itself or main library that it uses, might need extra custom license lines.
So I wonder if it's a good idea to add an optional field like extra_license to the model specs to include custom license.
Also, it is worth to mention, on hugging face, there are models that when the user clicks on the source tab, a popup will appear asking for the user agreement with a custom license lines. Maybe a boolean must_agree field would cover that too.

@FynnBe
Copy link
Member

FynnBe commented Nov 11, 2024

I'm not sure why this would need to be a separate field.
Couldn't we just allow for license: "custom" and then require a LICENSE file to be attached (=listed under attachments)?

Just a side node for this discussion: We have to manually archive such resource descriptions as zenodo does support custom licenses, but does not allow creating deposits with custom licesnes through their API -- one has to use the web UI.

@FynnBe
Copy link
Member

FynnBe commented Nov 11, 2024

Just took another look at zenodo docs licenses/#custom
-- Zenodo expectes a title and allows for an optional description and an optional link.
We could specify a custom license as license: {"title": <custom title>, "source": <relative path or URL to a '.md' or '.txt' file>} (not using attachments to avoid mapping conflicts in case we deal with multiple licenses, also see zenodo docs licenses/#mixed.

From that we can extract the title and always have the file inside the record as well... the content of which could be inserted to description (although it might exceed some character limit... ?) and/or linked to if given as URL. This would be optional for us and as we have to do it by hand we should probably just leave those blank.
If I'm not mistaken we can programmatically upload a deposit without license and then edit it in their web UI (logged in as the bioimageiobot).

As file extensions, github docs mention .txt, .md and .rst... not sure we need to support all three? maybe .txt and .md are sufficient for now. We deal with .md files already anyway (documentation). If requested it'd be easy to add .rst in the future.

@mese79
Copy link
Contributor Author

mese79 commented Nov 12, 2024

Nice! I didn't know that Zenodo can accept a custom license.
I think having a custom license with title and a link to a .txt or .md file would serve the purpose.

@FynnBe
Copy link
Member

FynnBe commented Nov 12, 2024

great! To implement this we should add a CustomLicense class to https://github.com/bioimage-io/spec-bioimage-io/blob/main/bioimageio/spec/generic/v0_3.py
and add it to the Union of the license field:

license: Annotated[
Annotated[
Union[LicenseId, DeprecatedLicenseId], Field(union_mode="left_to_right")
],
warn(
LicenseId,
"{value} is deprecated, see https://spdx.org/licenses/{value}.html",
),
Field(examples=["CC0-1.0", "MIT", "BSD-2-Clause"]),
]
"""A [SPDX license identifier](https://spdx.org/licenses/).
We do not support custom license beyond the SPDX license list, if you need that please
[open a GitHub issue](https://github.com/bioimage-io/spec-bioimage-io/issues/new/choose)
to discuss your intentions with the community."""

The implementation will look like this:

class CustomLicense(Node):
    title: NotEmpty[str]
    source: ImportantSourceFile

The added CustomLicense should be imported in the derived resource descriptions, e.g. model.v0_5 and notebook.v0_3... where the generic v0_3 license field is inherited.

@bioimage-io/spec-dev Happy to review any PRs on this. Otherwise I'll probably implement it in 2025.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants