Skip to content

Commit 3320c45

Browse files
authored
Merge pull request #60 from oeg-upm/dev
Fixed issue with input url and added somef configuration to its harvester
2 parents bdd666c + d774d00 commit 3320c45

11 files changed

Lines changed: 33 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
rsfc_env/
22
rsfc_output/
3+
test_env/
34
build/
45
dist/
56
outputs/

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ keywords:
2626
- indicators
2727
- fairness
2828
license: MIT
29-
version: 0.0.9
29+
version: 0.1.0

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
"operatingSystem": "Linux",
3535
"programmingLanguage": "Python",
3636
"relatedLink": "https://github.com/EVERSE-ResearchSoftware/indicators",
37-
"version": "0.0.9",
37+
"version": "0.1.0",
3838
"developmentStatus": "wip"
3939
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "rsfc"
3-
version = "0.0.9"
3+
version = "0.1.0"
44
description = "EVERSE Research Software Fairness Checks"
55
authors = ["Andres Montero <andres.montero.martin@upm.es>"]
66
license = "MIT"

src/rsfc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22

33

4-
__version__ = "0.0.9"
4+
__version__ = "0.1.0"
55

src/rsfc/harvesters/somef_harvester.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,29 @@
22
import contextlib
33
import json
44
from somef import somef_cli
5+
import subprocess
56
import os
67

78
class SomefHarvester:
89

910
def __init__(self, repo_url):
11+
self.somef_configure()
1012
self.somef_data = self.somef_assessment(repo_url, 0.8)
1113

14+
15+
def somef_configure(self):
16+
17+
print("Configuring SOMEF...")
18+
19+
try:
20+
subprocess.run(
21+
["somef", "configure", "-a"],
22+
check=True,
23+
stdout=subprocess.DEVNULL,
24+
stderr=subprocess.DEVNULL
25+
)
26+
except subprocess.CalledProcessError as e:
27+
raise RuntimeError("SOMEF configuration failed") from e
1228

1329
def somef_assessment(self, repo_url, threshold):
1430

src/rsfc/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ def main():
1111
print("Making preparations...")
1212

1313
from rsfc.rsfc_core import start_assessment
14-
from rsfc.utils.rsfc_helpers import resolve_w3id
14+
from rsfc.utils.rsfc_helpers import resolve_w3id, remove_git_from_url
1515
import os
1616
import json
1717

1818
print("Checking if url is w3id")
1919

2020
repo_url = resolve_w3id(args.repo)
21+
repo_url = remove_git_from_url(repo_url)
2122

2223
rsfc_asmt, table = start_assessment(repo_url, args.ftr, args.id)
2324

src/rsfc/model/indicator.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ def __init__(self, somef, cd, cf, gh):
107107
"RSFC-15-2": [
108108
(rt.test_license_spdx_compliant, [somef.somef_data])
109109
],
110-
"RSFC-15-3": [
111-
(rt.test_license_information_provided, [somef.somef_data])
112-
],
113110
"RSFC-16-1": [
114111
(rt.test_license_info_in_metadata_files, [somef.somef_data, cd.codemeta_data, cf.cff_data])
115112
],

src/rsfc/rsfc_tests/rsfc_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ def test_license_spdx_compliant(somef_data):
990990
return check.convert()
991991

992992

993-
def test_license_information_provided(somef_data):
993+
'''def test_license_information_provided(somef_data):
994994
995995
if 'license' not in somef_data:
996996
output = "false"
@@ -1010,7 +1010,7 @@ def test_license_information_provided(somef_data):
10101010
10111011
check = ch.Check(constants.INDICATORS_DICT['software_has_license'], 'RSFC-15-3', "License information is provided", constants.PROCESS_LICENSE_INFORMATION_PROVIDED, output, evidence, suggest)
10121012
1013-
return check.convert()
1013+
return check.convert()'''
10141014

10151015
################################################### FRSM_16 ###################################################
10161016

src/rsfc/utils/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@
419419
'rsfc' : {
420420
'name' : 'RSFC',
421421
'id' : 'https://w3id.org/rsfc/',
422-
'version' : '0.0.9'
422+
'version' : '0.1.0'
423423
}
424424
}
425425

0 commit comments

Comments
 (0)