Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.19468976.svg)](https://doi.org/10.5281/zenodo.19468976)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Version](https://img.shields.io/badge/version-0.4.3-blue.svg)](https://github.com/SoftwareUnderstanding/sw-metadata-bot/releases)
[![Version](https://img.shields.io/badge/version-0.5.0-blue.svg)](https://github.com/SoftwareUnderstanding/sw-metadata-bot/releases)
[![Python 3.11--3.12](https://img.shields.io/badge/python-3.11--3.12-blue.svg)](https://www.python.org/downloads/)
[![CI (build)](https://github.com/SoftwareUnderstanding/sw-metadata-bot/actions/workflows/ci.yml/badge.svg)](https://github.com/SoftwareUnderstanding/sw-metadata-bot/actions/workflows/ci.yml)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
Expand Down
6 changes: 4 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
},
"email": "tom.francois@lapp.in2p3.fr",
"@id": "https://orcid.org/0000-0001-5226-3089",
"givenName": "Tom",
"familyName": "François",
"@type": "Person"
}
],
"codeRepository": "https://github.com/SoftwareUnderstanding/sw-metadata-bot",
"dateCreated": "2025-12-15",
"dateModified": "2026-05-05",
"dateModified": "2026-06-03",
"datePublished": "2026-01-16",
"description": "A repository to keep the code of the RSMetaCheck bot for pushing issues with existing repository metadata",
"downloadUrl": "https://github.com/SoftwareUnderstanding/sw-metadata-bot/releases",
Expand All @@ -45,7 +47,7 @@
"python-dotenv>=1.0.0",
"requests>=2.32.5"
],
"version": "0.4.3",
"version": "0.5.0",
"codemeta:contIntegration": {
"@id": "https://raw.githubusercontent.com/SoftwareUnderstanding/sw-metadata-bot/main/.github/workflows/ci.yml"
},
Expand Down
6 changes: 3 additions & 3 deletions interrogate_badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sw-metadata-bot"
version = "0.4.3"
version = "0.5.0"
description = "Metadata quality bot for software repositories, leveraging metacheck for analysis and GitHub/GitLab APIs for issue management."
readme = "README.md"
requires-python = ">=3.11,<3.13"
Expand All @@ -14,7 +14,7 @@ authors = [
]
dependencies = [
"click>=8.3.1",
"rsmetacheck>=0.3.1",
"rsmetacheck>=0.3.2",
"python-dotenv>=1.0.0",
"requests>=2.32.5",
"setuptools[test]<83.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/sw_metadata_bot/config/schemas.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""configurations schemas for the bot, defined using Pydantic models for validation and parsing of config files."""

import json
from datetime import datetime, timezone
from pathlib import Path
Expand All @@ -15,11 +17,12 @@ class AnalysisConfig(BaseModel):
"""

repositories: list[str]
generate_codemeta_if_missing: Optional[bool] = True
generate_codemeta_if_missing: bool = True

@field_validator("repositories", mode="after")
@classmethod
def validate_repositories(cls, v):
"""Check that repositories list is not empty"""
if not v:
raise ValueError("Repositories list cannot be empty")
return v
Expand Down
8 changes: 8 additions & 0 deletions src/sw_metadata_bot/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,33 @@ class FakeIssueClient:
"""Issue client used only for local publish simulation."""

def __init__(self, comments_for=None):
"""
Initialize the fake issue client.
"""
self._comments_for = comments_for or (lambda url: [])
self.created: list[tuple[str, str, str]] = []
self.commented: list[str] = []
self.closed: list[str] = []

def create_issue(self, repo_url: str, title: str, body: str) -> str:
"""Create an issue and return a simulated issue URL."""
self.created.append((repo_url, title, body))
return f"{repo_url}/issues/99"

def get_issue(self, issue_url: str) -> dict[str, object]:
"""return simulated issue data, with state 'open' by default (can be overridden by test setup)"""
return {"state": "open"}

def get_issue_comments(self, issue_url: str) -> list[str]:
"""get simulated comments for the issue URL, as provided by the comments_for function"""
return self._comments_for(issue_url)

def add_issue_comment(self, issue_url: str, body: str) -> None:
"""add a comment to the issue URL (recording the action for test verification)"""
self.commented.append(issue_url)

def close_issue(self, issue_url: str) -> None:
"""simulate closing the issue at the given URL (recording the action for test verification)"""
self.closed.append(issue_url)


Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.