Add ConanVersionRange class and test - #102
Conversation
… against current 0.12.0 server (#498)
* Upload/Download retries + upload errors + wilcard upload * Remove xrange * Py3 exception message removed * Upload url * failing test with order in py3 * Revision memsharded * Not retry when a 404 or other controlled error happen
…error message with remotes
* Fixes sums with pyc and output error with non ascii. Also added messages to retry commands * Removed log * Exclude pyc from packages and manifests * New test, exclude pyc in loads * New test, exclude pyc in loads * Moved retry to uploader_downloader, removed UploadException, changed error message with remotes
* patch, pre, build to Version * patch, pre, build to Version * reverted to default stable() behavior * fixed broken Version() test
* build_requires in recipes * decoupling source folder * tests for local edition and no_copy_sources * fixed broken py3 test * fixed broken py3 test * fixed issue with local package build_folder nested * Ok * Fixed tests * PR: Revision
TG1999
left a comment
There was a problem hiding this comment.
Thanks, few nits for your consideration
| "nuget": "nuget", | ||
| "pypi": "pypi", | ||
| "packagist": "composer", | ||
| "conan1": "conan1", |
There was a problem hiding this comment.
It should be "conan" : "conan1" since gitlab uses conan in their package slug
There was a problem hiding this comment.
Thank you @TG1999. I made the change yesterday to conan1 to address an error I was getting when running this test:
pytest -vvs tests/test_version_range.py::test_conan_gitlab_version_range_parse
I just made the change you requested and reran that test, and again I get the same error. Here's an excerpt from a large terminal output:
(venv) Fri Feb 24, 2023 10:00 AM /home/jmh/dev/nexb/univers jmh (101-univers-support-for-conan)
$ pytest -vvs tests/test_version_range.py::test_conan_gitlab_version_range_parse
[...]
=================================================================================================== FAILURES ====================================================================================================
_______________________________________________________________________________ test_conan_gitlab_version_range_parse[test_case0] _______________________________________________________________________________
test_case = {'expected_vers': 'vers:conan1/>=5.1.0|<=5.1.1', 'native': '>=5.1.0 <=5.1.1', 'scheme': 'conan1', 'test_index': 1}
@pytest.mark.parametrize("test_case", json.load(open("./tests/data/conan_advisory.json")))
def test_conan_gitlab_version_range_parse(test_case):
if test_case["expected_vers"] is None:
with pytest.raises(InvalidVersion):
Conan1VersionRange.from_native(string=test_case["native"])
return
> result = from_gitlab_native(
gitlab_scheme=test_case["scheme"],
string=test_case["native"],
)
tests/test_version_range.py:364:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitlab_scheme = 'conan1', string = '>=5.1.0 <=5.1.1'
def from_gitlab_native(gitlab_scheme, string):
> purl_scheme = PURL_TYPE_BY_GITLAB_SCHEME[gitlab_scheme]
E KeyError: 'conan1'
src/univers/version_range.py:1106: KeyError
[...]
========================================================================================= 427 failed, 1 passed in 8.87s =========================================================================================
(venv) Fri Feb 24, 2023 10:00 AM /home/jmh/dev/nexb/univers jmh (101-univers-support-for-conan)
$
I was unable to identify the source of this error -- do you have any suggestions?
Meanwhile, I will implement your other comments and see if that resolves this set of error messages.
| { | ||
| "test_index": 1, | ||
| "scheme": "conan1", | ||
| "native": ">=5.1.0 <=5.1.1", |
There was a problem hiding this comment.
add a parameter "gitlab_scheme" : "conan" in every test here.
There was a problem hiding this comment.
@TG1999 Very interesting -- I'm getting a better sense of the structure we need for the gitlab advisory data. I've followed your suggestion and the JSON objects now look like this:
{
"test_index": 1,
"scheme": "conan1",
"native": ">=5.1.0 <=5.1.1",
"expected_vers": "vers:conan1/>=5.1.0|<=5.1.1",
"gitlab_scheme": "conan"
},
| Conan1VersionRange.from_native(string=test_case["native"]) | ||
| return | ||
| result = from_gitlab_native( | ||
| gitlab_scheme=test_case["scheme"], |
There was a problem hiding this comment.
| gitlab_scheme=test_case["scheme"], | |
| gitlab_scheme=test_case["gitlab_scheme"], |
There was a problem hiding this comment.
Outstanding @TG1999 -- with this and the 2 other sets of changes, all 428 of the test cases pass both Conan-related tests.
Thank you. 🙂 Will commit and push shortly.
Reference: #101 Signed-off-by: John M. Horan <johnmhoran@gmail.com>
Reference: #101 Signed-off-by: John M. Horan <johnmhoran@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: John M. Horan <johnmhoran@gmail.com>
|
In |
d5b29bb to
9f8c49a
Compare
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
9f8c49a to
48dc602
Compare
pombredanne
left a comment
There was a problem hiding this comment.
You are missing the ABOUT and license/notice files
|
@pombredanne @TG1999 I've added an |
|
@pombredanne @TG1999 I've also added a pair of |
Reference: #101 Signed-off-by: John M. Horan <johnmhoran@gmail.com>
|
@pombredanne @TG1999 I just committed and pushed and immediately saw that a GH check has failed -- https://github.com/nexB/univers/pull/102/checks?check_run_id=11840361414 I suspect these sign-off errors are from the commit histories of conan files added from the JFrog repo. How do we handle this? |
|
It's odd that this GH check would have failed after I committed and pushed my limited changes -- the JFrog Conan code had already been added by @TG1999 , and I retrieved it with a |
|
@johnmhoran thanks for adding the ABOUT files, we cannot do a lot for the DCO failing here because of reusing Conan commit history I have set DCO to pass. |
pombredanne
left a comment
There was a problem hiding this comment.
@johnmhoran Thanks... just one last nitpicking to add ABOUT files for the test code (and headers)
Reference: #101 Signed-off-by: John M. Horan <johnmhoran@gmail.com>
Fixes: