Skip to content

Commit 897bcc3

Browse files
authored
Add FAIR elements (#11)
* fix: typos in README.md * fair: add codemeta file * doc: improve documentation * dev: add interrogate in precommit and ci * doc: add interrogate badge in README.md * ci: add pypi publish when doing release
1 parent 6cce403 commit 897bcc3

File tree

11 files changed

+1135
-751
lines changed

11 files changed

+1135
-751
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches: ["main", "master"]
66
pull_request:
77
branches: ["*"]
8+
release:
9+
types: [published]
810

911
jobs:
1012
lint:
@@ -24,6 +26,24 @@ jobs:
2426
- name: Ruff check
2527
run: uv run ruff check --output-format=github
2628

29+
- name: Interrogate (docstring coverage)
30+
run: uv run interrogate -v src/sw_metadata_bot/
31+
32+
- name: Commit interrogate badge
33+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
34+
run: |
35+
uv run interrogate -o interrogate.svg -f src/sw_metadata_bot/
36+
git config user.name "github-actions[bot]"
37+
git config user.email "github-actions[bot]@users.noreply.github.com"
38+
git add interrogate.svg
39+
git diff --quiet && git diff --staged --quiet || git commit -m "chore: update interrogate badge"
40+
git push
41+
continue-on-error: true
42+
43+
- name: Bandit (security linter)
44+
run: uv run bandit -c pyproject.toml -r src/sw_metadata_bot/
45+
46+
2747
test:
2848
name: Test (pytest)
2949
runs-on: ubuntu-latest
@@ -86,3 +106,43 @@ jobs:
86106
- name: Deploy to GitHub Pages
87107
id: deployment
88108
uses: actions/deploy-pages@v4
109+
110+
publish-pypi:
111+
name: Publish to PyPI
112+
if: github.event_name == 'release'
113+
needs: [lint, test]
114+
runs-on: ubuntu-latest
115+
permissions:
116+
id-token: write
117+
steps:
118+
- uses: actions/checkout@v4
119+
120+
- name: Setup uv environment
121+
uses: ./.github/actions/setup-uv
122+
with:
123+
dependency-group: dev
124+
125+
- name: Build package
126+
run: uv build
127+
128+
- name: Publish to PyPI
129+
uses: pypa/gh-action-pypi-publish@release/v1
130+
with:
131+
packages-dir: dist/
132+
133+
# publish-zenodo:
134+
# name: Publish to Zenodo
135+
# if: github.event_name == 'release'
136+
# needs: [lint, test]
137+
# runs-on: ubuntu-latest
138+
# steps:
139+
# - uses: actions/checkout@v4
140+
141+
# - name: Publish to Zenodo
142+
# uses: leokratos/github-action-json-to-zenodo@v1.0.1
143+
# with:
144+
# filename: codemeta.json
145+
# zenodo_sandbox: false
146+
# env:
147+
# ZENODO_DEPOSITION_ID: ${{ secrets.ZENODO_DEPOSITION_ID }}
148+
# ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}

.pre-commit-config.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@ repos:
2020
rev: '1.9.3' # Update me!
2121
hooks:
2222
- id: bandit
23-
args: ["-c", "pyproject.toml"]
23+
args: ["-c", "pyproject.toml"]
24+
25+
- repo: https://github.com/econchick/interrogate
26+
rev: 1.7.0 # Update me!
27+
hooks:
28+
- id: interrogate
29+
name: interrogate
30+
entry: interrogate -c pyproject.toml -v src/sw_metadata_bot/
31+
pass_filenames: false
32+
always_run: true

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
44
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
5-
[![CI](https://github.com/codemetasoft/sw-metadata-bot/workflows/CI/badge.svg)](https://github.com/codemetasoft/sw-metadata-bot/actions)
6-
![coverage](https://img.shields.io/badge/coverage-placeholder-blue)
5+
[![CI](https://github.com/SoftwareUnderstanding/sw-metadata-bot/workflows/CI/badge.svg)](https://github.com/codemetasoft/sw-metadata-bot/actions)
76
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
87
![coverage](coverage.svg)
8+
![interrogate](interrogate.svg)
99

1010
An automated bot that analyzes repository metadata quality and creates issues with improvement suggestions.
1111

@@ -18,6 +18,7 @@ Part of the [CodeMetaSoft](https://w3id.org/codemetasoft) project to improve res
1818
If you received an issue from this bot, it means your repository's metadata was automatically analyzed and some improvements were detected.
1919

2020
The issue contains:
21+
2122
- **Pitfalls**: Critical metadata issues that should be fixed
2223
- **Warnings**: Metadata improvements that are recommended
2324
- **Suggestions**: Specific recommendations on how to fix each issue
@@ -52,11 +53,13 @@ Simply comment **"unsubscribe"** on the issue and we'll remove your repository f
5253
## 🔍 What Analysis Is Used
5354

5455
This bot uses [RSMetaCheck](https://github.com/SoftwareUnderstanding/RsMetaCheck), which analyzes:
56+
5557
- Software metadata completeness
5658
- Citation and documentation quality
5759
- Repository structure and best practices
5860

5961
The bot **does not**:
62+
6063
- Modify your code or files
6164
- Make pull requests
6265
- Have access to your repository secrets
@@ -76,6 +79,7 @@ The bot **does not**:
7679
See [QUICKSTART.md](QUICKSTART.md) for setup and usage instructions.
7780

7881
Supported platforms:
82+
7983
- ✅ GitHub.com
8084
- ✅ GitLab.com
8185
- ✅ Self-hosted GitLab instances

codemeta.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"@context": "https://w3id.org/codemeta/3.0",
3+
"applicationCategory": "SoftwareSourceCode",
4+
"author": [
5+
{
6+
"@id": "https://github.com/SoftwareUnderstanding",
7+
"@type": "Organization"
8+
},
9+
{
10+
"affiliation": {
11+
"name": "Univ. Savoie Mont-Blanc, CNRS, LAPP",
12+
"@type": "Organization"
13+
},
14+
"email": "tom.francois@lapp.in2p3.fr",
15+
"@id": "https://orcid.org/0000-0001-5226-3089",
16+
"@type": "Person"
17+
}
18+
],
19+
"codeRepository": "https://github.com/SoftwareUnderstanding/sw-metadata-bot",
20+
"dateCreated": "2025-12-15",
21+
"dateModified": "2026-01-21",
22+
"datePublished": "2026-01-16",
23+
"description": "A repository to keep the code of the RSMetaCheck bot for pushing issues with existing repository metadata",
24+
"downloadUrl": "https://github.com/SoftwareUnderstanding/sw-metadata-bot/releases",
25+
"keywords": [
26+
"codemeta",
27+
"bot",
28+
"software",
29+
"metadata"
30+
],
31+
"license": "https://spdx.org/licenses/MIT",
32+
"name": "sw-metadata-bot",
33+
"programmingLanguage": "Python 3",
34+
"releaseNotes": "## What's Changed\n* Fix beta test feedbacks by @francoto in https://github.com/SoftwareUnderstanding/sw-metadata-bot/pull/7\n\n\n**Full Changelog**: https://github.com/SoftwareUnderstanding/sw-metadata-bot/compare/v0.1.0...v0.1.1",
35+
"softwareRequirements": [
36+
"metacheck>=0.2.0",
37+
"requests>=2.32.5"
38+
],
39+
"version": "v0.1.1",
40+
"codemeta:contIntegration": {
41+
"@id": "https://raw.githubusercontent.com/SoftwareUnderstanding/sw-metadata-bot/main/.github/workflows/ci.yml"
42+
},
43+
"continuousIntegration": "https://raw.githubusercontent.com/SoftwareUnderstanding/sw-metadata-bot/main/.github/workflows/ci.yml",
44+
"developmentStatus": "active",
45+
"issueTracker": "https://github.com/SoftwareUnderstanding/sw-metadata-bot/issues",
46+
"@type": "SoftwareSourceCode"
47+
}

docs/api.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
API Reference
2+
=============
3+
4+
This section documents all modules and functions in the sw-metadata-bot package.
5+
6+
Main Module
7+
-----------
8+
9+
.. automodule:: sw_metadata_bot.main
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:
13+
14+
Pitfalls Module
15+
---------------
16+
17+
.. automodule:: sw_metadata_bot.pitfalls
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
22+
GitHub API Module
23+
-----------------
24+
25+
.. automodule:: sw_metadata_bot.github_api
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:
29+
30+
GitLab API Module
31+
-----------------
32+
33+
.. automodule:: sw_metadata_bot.gitlab_api
34+
:members:
35+
:undoc-members:
36+
:show-inheritance:
37+
38+
Create Issues Module
39+
--------------------
40+
41+
.. automodule:: sw_metadata_bot.create_issues
42+
:members:
43+
:undoc-members:
44+
:show-inheritance:
45+
46+
MetaCheck Wrapper Module
47+
------------------------
48+
49+
.. automodule:: sw_metadata_bot.metacheck_wrapper
50+
:members:
51+
:undoc-members:
52+
:show-inheritance:

docs/conf.py

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,52 @@
11
import os
22
import sys
33

4-
project = "sw-metadata-bot"
5-
author = "Tom François"
6-
74
# Ensure src is on the path for autodoc
85
sys.path.insert(0, os.path.abspath("../src"))
96

7+
# Project information
8+
project = "sw-metadata-bot"
9+
author = "Tom François"
10+
copyright = "2026, Tom François"
11+
release = "0.1.1"
12+
version = "0.1"
13+
14+
# Extensions
1015
extensions = [
1116
"sphinx.ext.autodoc",
1217
"sphinx.ext.napoleon",
18+
"sphinx.ext.viewcode",
19+
"sphinx.ext.intersphinx",
1320
]
1421

22+
# Autodoc settings
23+
autodoc_default_options = {
24+
"members": True,
25+
"member-order": "bysource",
26+
"special-members": "__init__",
27+
"undoc-members": True,
28+
"exclude-members": "__weakref__",
29+
}
30+
autodoc_typehints = "description"
31+
32+
# Napoleon settings for Google/NumPy style docstrings
33+
napoleon_google_docstring = True
34+
napoleon_numpy_docstring = True
35+
napoleon_include_init_with_doc = True
36+
37+
# Intersphinx mapping
38+
intersphinx_mapping = {
39+
"python": ("https://docs.python.org/3", None),
40+
"requests": ("https://requests.readthedocs.io/en/latest/", None),
41+
}
42+
1543
templates_path = ["_templates"]
16-
exclude_patterns = []
44+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
1745

46+
# HTML output
1847
html_theme = "furo"
19-
html_static_path = ["_static"]
48+
html_static_path = []
49+
html_title = f"{project} {release}"
50+
html_theme_options = {
51+
"sidebar_hide_name": False,
52+
}

docs/index.rst

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
Welcome to sw-metadata-bot's documentation
22
==========================================
33

4+
An automated bot that analyzes repository metadata quality and creates issues with improvement suggestions.
5+
6+
Part of the `CodeMetaSoft <https://w3id.org/codemetasoft>`_ project.
7+
48
.. toctree::
59
:maxdepth: 2
610
:caption: Contents:
711

12+
installation
13+
usage
14+
api
15+
16+
Quick Start
17+
-----------
18+
19+
Install the package:
20+
21+
.. code-block:: bash
22+
23+
pip install sw-metadata-bot
24+
25+
Run analysis:
26+
27+
.. code-block:: bash
28+
29+
sw-metadata-bot metacheck --repository-url https://github.com/example/repo
830
9-
API Reference
10-
-------------
31+
Indices and tables
32+
==================
1133

12-
.. automodule:: sw_metadata_bot.main
13-
:members:
14-
:undoc-members:
15-
:show-inheritance:
34+
* :ref:`genindex`
35+
* :ref:`modindex`
36+
* :ref:`search`

docs/installation.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Installation
2+
============
3+
4+
Requirements
5+
------------
6+
7+
- Python 3.11 or 3.12
8+
- uv (recommended) or pip
9+
10+
Using uv (recommended)
11+
----------------------
12+
13+
.. code-block:: bash
14+
15+
uv pip install sw-metadata-bot
16+
17+
Using pip
18+
---------
19+
20+
.. code-block:: bash
21+
22+
pip install sw-metadata-bot
23+
24+
From source
25+
-----------
26+
27+
.. code-block:: bash
28+
29+
git clone https://github.com/SoftwareUnderstanding/sw-metadata-bot.git
30+
cd sw-metadata-bot
31+
uv sync
32+
uv run sw-metadata-bot --help

0 commit comments

Comments
 (0)