-
Notifications
You must be signed in to change notification settings - Fork 27
clean warnings. Package build as url instead of string, readthedocs, Fixes #855, Fixes #864, Fixes #865, Fixes #866, #873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,8 @@ def test_parse_gemspec(self): | |
|
|
||
| package_results = metadata_result.results.get(constants.CAT_HAS_PACKAGE_FILE, []) | ||
| self.assertTrue(len(package_results) > 0, "No package file info found") | ||
| self.assertEqual(package_results[0]["result"]["value"], "bootstrap-datepicker-rails.gemspec") | ||
| # self.assertEqual(package_results[0]["result"]["value"], "bootstrap-datepicker-rails.gemspec") | ||
| self.assertEqual(package_results[0]["result"]["value"], "https://example.org/bootstrap-datepicker-rails.gemspec") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| self.assertEqual(package_results[0]["result"]["type"], constants.URL) | ||
|
|
||
| id_results = metadata_result.results.get(constants.CAT_PACKAGE_ID, []) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,8 @@ def test_parse_package_json_file(self): | |
|
|
||
| package_results = metadata_result.results.get(constants.CAT_HAS_PACKAGE_FILE, []) | ||
| self.assertTrue(len(package_results) > 0, "No package file info found") | ||
| self.assertEqual(package_results[0]["result"]["value"], "package.json") | ||
| # self.assertEqual(package_results[0]["result"]["value"], "package.json") | ||
| self.assertEqual(package_results[0]["result"]["value"], "http://example.com/package_neors.json") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| self.assertEqual(package_results[0]["result"]["type"], constants.URL) | ||
|
|
||
| keywords_results = metadata_result.results.get(constants.CAT_KEYWORDS, []) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,11 +56,15 @@ def test_parse_cargo_toml(self): | |
| ) | ||
|
|
||
| result = Result() | ||
| parse_toml_file(self.cargo_toml_path, result, "test") | ||
| # parse_toml_file(self.cargo_toml_path, result, "test") | ||
| print("self.cargo_toml_path:", self.cargo_toml_path) | ||
| parse_toml_file(self.cargo_toml_path, result, "http://example.com/rustdesk/Cargo.toml") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
|
|
||
| self.assertIn(constants.CAT_HAS_PACKAGE_FILE, result.results) | ||
| package_file = result.results[constants.CAT_HAS_PACKAGE_FILE][0]["result"]["value"] | ||
| self.assertEqual(package_file, "Cargo.toml") | ||
|
|
||
| # self.assertEqual(package_file, "Cargo.toml") | ||
| self.assertEqual(package_file, "http://example.com/rustdesk/Cargo.toml") | ||
|
|
||
| self.assertIn(constants.CAT_PACKAGE_ID, result.results) | ||
| package_id = result.results[constants.CAT_PACKAGE_ID][0]["result"]["value"] | ||
|
|
@@ -102,7 +106,8 @@ def test_parse_pluto_project_toml(self): | |
|
|
||
| package_results = metadata_result.results.get(constants.CAT_HAS_PACKAGE_FILE, []) | ||
| self.assertTrue(len(package_results) > 0, "No package file info found") | ||
| self.assertEqual(package_results[0]["result"]["value"], "Project.toml") | ||
| # self.assertEqual(package_results[0]["result"]["value"], "Project.toml") | ||
| self.assertEqual(package_results[0]["result"]["value"], "http://example.com/repo1/Project.toml") | ||
| self.assertEqual(package_results[0]["result"]["type"], constants.URL) | ||
| self.assertEqual(package_results[0]["technique"], constants.TECHNIQUE_CODE_CONFIG_PARSER) | ||
|
|
||
|
|
@@ -168,7 +173,8 @@ def test_parse_flux_project_toml(self): | |
|
|
||
| package_results = metadata_result.results.get(constants.CAT_HAS_PACKAGE_FILE, []) | ||
| self.assertTrue(len(package_results) > 0, "No package file info found") | ||
| self.assertEqual(package_results[0]["result"]["value"], "Project.toml") | ||
| # self.assertEqual(package_results[0]["result"]["value"], "Project.toml") | ||
| self.assertEqual(package_results[0]["result"]["value"], "http://example.com/repo2/Project.toml") | ||
|
|
||
| package_id_results = metadata_result.results.get(constants.CAT_PACKAGE_ID, []) | ||
| self.assertTrue(len(package_id_results) > 0, "No package ID found") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,12 +54,12 @@ | |
| REGEXP_READTHEDOCS_MD = ( | ||
| r"\(\s*(https?://[^\s\)]+\.readthedocs\.io[^\s\)]*)\s*\)" | ||
| ) | ||
| # REGEXP_READTHEDOCS_HTML = ( | ||
| # r"<a[^>]+href=['\"](https?://[^\s\"']+\.readthedocs\.io[^\s\"']*)['\"][^>]*>" | ||
| # r"(?:\s|<[^>]+>)*" | ||
| # r"<img[^>]+src=['\"]https?://readthedocs\.org/projects/[^\s/]+/badge/[^\s\"']*" | ||
| # ) | ||
| REGEXP_READTHEDOCS_HTML = ( r"<a[^>]+href=['\"](https?://[^\s\"']+)['\"][^>]*>" r"(?:\s|<[^>]+>)*" r"<img[^>]+src=['\"]https?://readthedocs\.org/projects/[^\s/]+/badge/[^\s\"']*" ) | ||
|
|
||
| REGEXP_READTHEDOCS_HTML = ( | ||
| r"<a\b[^>]+?href=['\"](https?://[^'\"\s]+?)['\"][^>]*?>" | ||
| r"(?:(?!</a>)[\s\S])*?" | ||
| r"<img\b[^>]+?src=['\"]https?://(?:readthedocs\.org/projects/|img\.shields\.io/pypi/)[^'\"\s]*" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This regular expression is potentially dangerous, and it may be slow.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, i'll try again after all test pass |
||
| ) | ||
| # For natural language citation | ||
| REGEXP_DOI_NATURAL = r'10\.\d{4,9}/[-._;()/:A-Za-z0-9]+' | ||
| REGEXP_YEAR_NATURAL = r'\b(19|20)\d{2}\b' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this looking into example.org?
If somef is run locally and there is no repo, it should return the path to the file...