fair-software / howfairis

Command line tool to analyze a GitHub or GitLab repository's compliance with the fair-software.eu recommendations
https://pypi.org/project/howfairis/
Apache License 2.0
54 stars 22 forks source link

conan.io C++ packages need to be recognized as registry #368

Open mattkretz opened 3 days ago

mattkretz commented 3 days ago

https://github.com/NLeSC/awesome-research-software-registries lists https://conan.io for C++, but howfairis does not recognize projects that are available through Conan.

The solution seems to be a simple

--- a/howfairis/mixins/registry_mixin.py
+++ b/howfairis/mixins/registry_mixin.py
@@ -14,6 +14,7 @@ class RegistryMixin:
             results = [
                 self.has_ascl_badge(),
                 self.has_bintray_badge(),
+                self.has_conan_badge(),
                 self.has_conda_badge(),
                 self.has_cran_badge(),
                 self.has_crates_badge(),
@@ -43,6 +44,11 @@ class RegistryMixin:
                    r"https://img\.shields\.io/bintray/.*"]
         return self._eval_regexes(regexes)

+    def has_conan_badge(self):
+        """ """
+        regexes = [r"https://img\.shields\.io/conan/.*"]
+        return self._eval_regexes(regexes)
+
     def has_conda_badge(self):
         """ """
         regexes = [r"https://anaconda\.org/.*/.*/badges/downloads\.svg",

While recognizing conan badges is simple, fixing the tests to not fail after the change is way more complex. I could use some help there. I tried to adjust the expected snippets and add a test_has_conan_badge function to test_checker_.... But now pytest errors out with 'UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 18: invalid continuation byte' all over the place. Even after switching back to the 'main' branch with a clean 'git status'. I'm no Python expert... how do I reset this thing without starting over completely?

mattkretz commented 3 days ago

Oh, the tests pick up vim's .*.swp files (binary) and try to interpret them as utf-8. Not helpful.

mattkretz commented 3 days ago

OK, managed to adjust the tests. IMHO, adjusting tests for a new badge is way too complex.

May I open a PR?

jspaaks commented 3 days ago

Hi @mattkretz, thanks for reporting this. Let me ping @fdiblen and @c-martinez for you, they might be able to tell you how best to go about this.