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 @@ +[![Adapt logo](https://adaptjs.org/img/logo_lockup.svg)](https://adaptjs.org) + +[![npm](https://img.shields.io/npm/v/@adpt/cli?color=blue)](https://www.npmjs.com/package/@adpt/cli) +[![Gitter](https://badges.gitter.im/UnboundedSystems/Adapt.svg)](https://gitter.im/UnboundedSystems/Adapt) +[![License](https://img.shields.io/github/license/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 `
`, Adapt specifications use elements like AWS ``, Kubernetes ``, or `` database. + +If you're already familiar with React, you'll feel right at home with Adapt. +But if not, don't worry, knowledge of React isn't required to start using Adapt. + +## Getting Started + +For a new project, it's easy to get started with Adapt by using a starter template. +The [Getting Started Guide](https://adaptjs.org/docs/getting_started) will walk through installing Adapt and deploying your first starter app. + +## Creating and deploying an app + +This example creates a new full-stack app from a starter template. +It has a [React](https://reactjs.org) UI, an [Nginx](https://nginx.org) web server, a [Node.js](https://nodejs.org) API server, and a [Postgres](https://postgresql.org) database, then deploys it to [Kubernetes](https://kubernetes.io/): + +```bash +# Install adapt +npm install -g @adpt/cli + +# Create a new app from a starter template +adapt new hello-react-node-postgres ./myapp +cd myapp/deploy + +# Deploy full stack locally using Docker +adapt run laptop + +# Or just as easily deploy everything to Kubernetes +adapt run k8s-test +``` + +An Adapt description for a complete front end and back end app stack looks like this: + +```jsx +import Adapt from "@adpt/core"; +import { NodeService, ReactApp } from "@adpt/cloud/nodejs"; +import { Postgres } from "@adpt/cloud/postgres"; + +function MyApp() { + const pg = Adapt.handle(); + + return ( + + + + + + ); +} +``` + +## Adapt in action + +This demo shows using Adapt to create and deploy a simple app called MovieDB that has a [React](https://reactjs.org) UI, an [Nginx](https://nginx.org) web server, an Nginx URL router, a [Node.js](https://nodejs.org) API server, and a [Postgres](https://postgresql.org) database, then deploys it to [Kubernetes](https://kubernetes.io/): + +![Adapt in action](https://adaptjs.org/docs/assets/getting_started/adapt-demo-scaled.gif) + +## More info + +* [Adaptjs.org](https://adaptjs.org) + + Learn more about Adapt. + +* [Getting Started Guide](https://adaptjs.org/docs/getting_started) + + This guide will walk you through setting up Adapt and then deploying an example MovieDB app. + +* [Adapt Documentation](https://adaptjs.org/docs) + + Adapt tutorials, API References, and more. + +## Getting Help + +[![Gitter](https://badges.gitter.im/UnboundedSystems/Adapt.svg)](https://gitter.im/UnboundedSystems/Adapt) + +We'd love to hear about your experience with Adapt! +Join us on our [Gitter channel](https://gitter.im/UnboundedSystems/Adapt) to ask questions or to give us your feedback and suggestions. + +If you've found a bug, you can also [file an issue](https://gitlab.com/unboundedsystems/adapt/issues).