diff --git a/src/somef/parser/toml_parser.py b/src/somef/parser/toml_parser.py index e87269d0..fb330806 100644 --- a/src/somef/parser/toml_parser.py +++ b/src/somef/parser/toml_parser.py @@ -524,8 +524,9 @@ def parse_pyproject_metadata(data, metadata_result, source, file_path): metadata_result.add_result( constants.CAT_RUNTIME_PLATFORM, { - "value": runtime["version"], + "value": f'{runtime["name"]}{runtime["version"]}', "name": runtime["name"], + "version": runtime["version"], "type": constants.STRING }, 1, diff --git a/src/somef/somef_cli.py b/src/somef/somef_cli.py index 1ea81329..4b91127c 100644 --- a/src/somef/somef_cli.py +++ b/src/somef/somef_cli.py @@ -81,13 +81,6 @@ def cli_get_data(threshold, ignore_classifiers, repo_url=None, doc_src=None, loc repo_type, authorization ) - print("\n=== DEBUG GITLAB SELF-HOSTED ===") - print(f"repo_url: {repo_url}") - print(f"owner: {owner}") - print(f"repo_name: {repo_name}") - print(f"def_branch: {def_branch}") - print(f"repo_type: {repo_type}") - print("=================================\n") # download files and obtain path to download folder if readme_only: diff --git a/src/somef/test/test_cli.py b/src/somef/test/test_cli.py index d871e640..c5d2ab0f 100644 --- a/src/somef/test/test_cli.py +++ b/src/somef/test/test_cli.py @@ -447,17 +447,19 @@ def test_issue_314(self): def test_issue_314_1(self): """Checks that the program can be run using only a single readme. GitHub""" somef_cli.run_cli(threshold=0.8, - ignore_classifiers=False, - repo_url="https://github.com/tensorflow/tensorflow/tree/v2.6.0", - doc_src=None, - in_file=None, - output=test_data_path + "test-314-1.json", - graph_out=None, - graph_format="turtle", - codemeta_out=None, - pretty=True, - missing=True, - readme_only=True) + ignore_classifiers=False, + # repo_url="https://github.com/tensorflow/tensorflow/tree/v2.6.0", + repo_url=None, + # doc_src=None, + doc_src= test_data_path + "README-tensorflow-2.6.0.md", + in_file=None, + output=test_data_path + "test-314-1.json", + graph_out=None, + graph_format="turtle", + codemeta_out=None, + pretty=True, + missing=True, + readme_only=True) text_file = open(test_data_path + "test-314-1.json", "r") data = text_file.read() text_file.close() @@ -469,17 +471,19 @@ def test_issue_314_1(self): def test_issue_314_2(self): """Checks that the program can be run using only a single readme. Gitlab""" somef_cli.run_cli(threshold=0.8, - ignore_classifiers=False, - repo_url="https://gitlab.com/jleblay/tokei", - doc_src=None, - in_file=None, - output=test_data_path + "test-314-2.json", - graph_out=None, - graph_format="turtle", - codemeta_out=None, - pretty=True, - missing=False, - readme_only=True) + ignore_classifiers=False, + # repo_url="https://gitlab.com/jleblay/tokei", + repo_url=None, + # doc_src=None, + doc_src= test_data_path + "README-tokei.md", + in_file=None, + output=test_data_path + "test-314-2.json", + graph_out=None, + graph_format="turtle", + codemeta_out=None, + pretty=True, + missing=False, + readme_only=True) text_file = open(test_data_path + "test-314-2.json", "r") data = text_file.read() text_file.close() @@ -491,17 +495,19 @@ def test_issue_314_2(self): def test_issue_314_3(self): """Checks that the program can be run using only a single readme. Gitlab""" somef_cli.run_cli(threshold=0.8, - ignore_classifiers=False, - repo_url="https://gitlab.com/unboundedsystems/adapt/-/tree/release-0.1", - doc_src=None, - in_file=None, - output=test_data_path + "test-314-3.json", - graph_out=None, - graph_format="turtle", - codemeta_out=None, - pretty=True, - missing=True, - readme_only=True) + ignore_classifiers=False, + # repo_url="https://gitlab.com/unboundedsystems/adapt/-/tree/release-0.1", + repo_url=None, + # doc_src=None, + doc_src= test_data_path + "README-unboundedsystems.md", + in_file=None, + output=test_data_path + "test-314-3.json", + graph_out=None, + graph_format="turtle", + codemeta_out=None, + pretty=True, + missing=True, + readme_only=True) text_file = open(test_data_path + "test-314-3.json", "r") data = text_file.read() text_file.close() @@ -530,6 +536,8 @@ def test_issue_403(self): somef_cli.run_cli(threshold=0.8, ignore_classifiers=False, repo_url="https://github.com/oeg-upm/wot-hive", + # repo_url=None, + # local_repo=test_data_repositories + "wot-hive", doc_src=None, in_file=None, output=test_data_path + "test-403.json", @@ -589,7 +597,6 @@ def test_issue_225_406(self): text_file = open(test_data_path + "test-225.json", "r") data = text_file.read() text_file.close() - print(data) assert data.find("\"" + constants.PROP_FORMAT + "\": \"" + constants.FORMAT_WIKI + "\"") os.remove(test_data_path + "test-225.json") @@ -617,18 +624,20 @@ def test_issue_406(self): def test_issue_255(self): """Tests if somef can detect wiki articles""" somef_cli.run_cli(threshold=0.8, - ignore_classifiers=False, - repo_url="https://github.com/mbloch/mapshaper/", - local_repo=None, - doc_src=None, - in_file=None, - output=test_data_path + "test-255.json", - graph_out=None, - graph_format="turtle", - codemeta_out=None, - pretty=True, - missing=True, - readme_only=False) + ignore_classifiers=False, + # repo_url="https://github.com/mbloch/mapshaper/", + repo_url=None, + local_repo=None, + # doc_src=None, + doc_src=test_data_path + "README-mapshaper.md", + in_file=None, + output=test_data_path + "test-255.json", + graph_out=None, + graph_format="turtle", + codemeta_out=None, + pretty=True, + missing=True, + readme_only=False) text_file = open(test_data_path + "test-255.json", "r") data = text_file.read() text_file.close() diff --git a/src/somef/test/test_data/README-unboundedsystems.md b/src/somef/test/test_data/README-unboundedsystems.md new file mode 100644 index 00000000..7183625a --- /dev/null +++ b/src/somef/test/test_data/README-unboundedsystems.md @@ -0,0 +1,86 @@ +[](https://adaptjs.org) + +[](https://www.npmjs.com/package/@adpt/cli) +[](https://gitter.im/UnboundedSystems/Adapt) +[](https://opensource.org/licenses/Apache-2.0) + +# Adapt - ReactJS for your infrastructure. + +AdaptJS is a system to easily, reliably, and repeatably deploy your full-stack applications. Adapt specifications look like [React](https://reactjs.org) apps, but instead of rendering browser DOM elements like ``, or `