Skip to content

Commit fe0fd43

Browse files
authored
Fix rsmetacheck pypi source (#68)
* update rsmetacheck to its pypi version (remove git) - metacheck has been renamed to rsmetacheck * update coverage badge (was failing because coverage-badge is a bit broken due to setup_tools update [issue](dbrgn/coverage-badge#33)
1 parent dba5aa1 commit fe0fd43

8 files changed

Lines changed: 3979 additions & 443 deletions

File tree

codemeta.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
"programmingLanguage": "Python 3",
3434
"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",
3535
"softwareRequirements": [
36-
"metacheck>=0.2.0",
37-
"requests>=2.32.5"
36+
"click>=8.3.1",
37+
"rsmetacheck>=0.2.1",
38+
"python-dotenv>=1.0.0",
39+
"requests>=2.32.5"
3840
],
3941
"version": "0.3.1",
4042
"codemeta:contIntegration": {

coverage.svg

Lines changed: 3 additions & 3 deletions
Loading

interrogate_badge.svg

Lines changed: 3 additions & 3 deletions
Loading

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ authors = [
1414
]
1515
dependencies = [
1616
"click>=8.3.1",
17-
"metacheck>=0.2.1",
17+
"rsmetacheck>=0.2.1",
1818
"python-dotenv>=1.0.0",
1919
"requests>=2.32.5",
20+
"setuptools[test]<82.0.0",
2021
]
2122

2223
keywords = ["codemeta", "metadata", "bot", "quality software"]
@@ -66,8 +67,6 @@ packages = { find = { where = ["src"] } }
6667
# Start year for copyright range (displayed as "YYYY–present" in docs)
6768
copyright_year = "2026"
6869

69-
[tool.uv.sources]
70-
metacheck = { git = "https://github.com/SoftwareUnderstanding/RsMetaCheck"}
7170

7271
[tool.pytest.ini_options]
7372
testpaths = ["tests"]
@@ -109,4 +108,4 @@ color = true
109108
omit-covered-files = false
110109
# output file location
111110
generate-badge = "."
112-
badge-format = "svg"
111+
badge-format = "svg"

src/sw_metadata_bot/pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
resolve_snapshot_tag,
2020
sanitize_repo_name,
2121
)
22-
from .metacheck_wrapper import metacheck_command
22+
from .rsmetacheck_wrapper import rsmetacheck_command
2323

2424
SNAPSHOT_TAG_PATTERN = re.compile(r"^(\d{8})(?:_(\d+))?$")
2525
SNAPSHOT_INCREMENT_PATTERN = re.compile(r"^(.+?)_(\d+)$")
@@ -214,7 +214,7 @@ def run_pipeline(
214214

215215
if not reused_previous:
216216
analysis_runtime.run_metacheck_for_repo(
217-
repo_url, repo_folder, metacheck_command
217+
repo_url, repo_folder, rsmetacheck_command
218218
)
219219

220220
normalized_repo = analysis_runtime.normalize_repo_url(repo_url)

src/sw_metadata_bot/metacheck_wrapper.py renamed to src/sw_metadata_bot/rsmetacheck_wrapper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
default=0.8,
4141
help="SoMEF confidence threshold (default: 0.8).",
4242
)
43-
def metacheck_command(
43+
def rsmetacheck_command(
4444
input, skip_somef, somef_output, pitfalls_output, analysis_output, threshold
4545
):
46-
"""Run metacheck to detect metadata pitfalls in repositories."""
47-
# Convert click arguments to sys.argv format for metacheck's argparse
48-
argv = ["metacheck"]
46+
"""Run rsmetacheck to detect metadata pitfalls in repositories."""
47+
# Convert click arguments to sys.argv format for rsmetacheck's argparse
48+
argv = ["rsmetacheck"]
4949

5050
# Add input files
5151
argv.extend(["--input", input.strip()])

tests/test_pipeline.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ def test_run_pipeline_invokes_metacheck_and_writes_reports(monkeypatch, tmp_path
116116
"""Invoke metacheck with expected args and write analysis reports per snapshot."""
117117
calls: dict[str, dict] = {}
118118

119-
def fake_metacheck_main(*, args, standalone_mode):
119+
def fake_rsmetacheck_main(*, args, standalone_mode):
120120
"""Capture metacheck invocation arguments for assertions."""
121121
calls["metacheck"] = {"args": args, "standalone_mode": standalone_mode}
122122

123-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
123+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_rsmetacheck_main)
124124

125125
output_root = tmp_path / "outputs"
126126
config = _write_config(
@@ -165,7 +165,7 @@ def fake_metacheck_main(*, args, standalone_mode):
165165
"""Accept metacheck invocation without side effects."""
166166
return None
167167

168-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
168+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
169169

170170
output_root = tmp_path / "outputs"
171171
config = _write_config(
@@ -288,7 +288,7 @@ def fake_metacheck_main(*, args, standalone_mode):
288288
"""Capture metacheck invocation to keep test side-effect free."""
289289
calls["metacheck"] = {"args": args, "standalone_mode": standalone_mode}
290290

291-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
291+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
292292

293293
output_root = tmp_path / "outputs"
294294
config = _write_config(
@@ -327,7 +327,7 @@ def fake_metacheck_main(*, args, standalone_mode):
327327
"""Capture metacheck invocation arguments for assertions."""
328328
calls["metacheck"] = {"args": args, "standalone_mode": standalone_mode}
329329

330-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
330+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
331331

332332
output_root = tmp_path / "outputs"
333333
config = _write_config(
@@ -416,7 +416,7 @@ def fake_metacheck_main(*, args, standalone_mode):
416416
"""Track unexpected metacheck invocation."""
417417
called["metacheck"] = True
418418

419-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
419+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
420420
monkeypatch.setattr(
421421
commit_lookup, "get_repo_head_commit", lambda repo_url: "abc123"
422422
)
@@ -512,7 +512,7 @@ def fake_metacheck_main(*, args, standalone_mode):
512512
)
513513
(repo_folder / "somef_output.json").write_text("{}")
514514

515-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
515+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
516516

517517
def fake_get_head(repo_url: str) -> str | None:
518518
"""Return deterministic commit hash for unchanged repo."""
@@ -617,7 +617,7 @@ def fake_metacheck_main(*, args, standalone_mode):
617617
"""Record the call arguments for metacheck."""
618618
calls["metacheck"] = {"args": args, "standalone_mode": standalone_mode}
619619

620-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
620+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
621621

622622
output_root = tmp_path / "outputs"
623623
config = _write_config(
@@ -654,7 +654,7 @@ def fake_metacheck_main(*, args, standalone_mode):
654654
"""Mark metacheck as called."""
655655
called["metacheck"] = True
656656

657-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
657+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
658658
monkeypatch.setattr(
659659
commit_lookup, "get_repo_head_commit", lambda repo_url: "abc123"
660660
)
@@ -731,7 +731,7 @@ def fake_metacheck_main(*, args, standalone_mode):
731731
"""Mark metacheck as called."""
732732
called["metacheck"] = True
733733

734-
monkeypatch.setattr(pipeline.metacheck_command, "main", fake_metacheck_main)
734+
monkeypatch.setattr(pipeline.rsmetacheck_command, "main", fake_metacheck_main)
735735
monkeypatch.setattr(
736736
commit_lookup, "get_repo_head_commit", lambda repo_url: "abc123"
737737
)

0 commit comments

Comments
 (0)