Skip to content

Commit

Permalink
Merge branch 'main' into 371-python-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
fdiblen authored Oct 17, 2024
2 parents c4ce1b4 + d3767ae commit 0b3d4ad
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ looks something like this:
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down Expand Up @@ -302,6 +303,7 @@ The manual override will be reflected in the output, as follows:
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down
9 changes: 8 additions & 1 deletion howfairis/mixins/registry_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def check_registry(self):
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(),
Expand Down Expand Up @@ -43,6 +44,11 @@ def has_bintray_badge(self):
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",
Expand Down Expand Up @@ -71,7 +77,8 @@ def has_maven_badge(self):
""" """
regexes = [r"https://badgen.net/maven/v/maven-central/.*",
r"https://img\.shields\.io/maven-central/.*",
r"https://img\.shields\.io/maven-metadata/.*"]
r"https://img\.shields\.io/maven-metadata/.*",
r"https://maven-badges.herokuapp.com/maven-central/.*"]
return self._eval_regexes(regexes)

def has_npm_badge(self):
Expand Down
1 change: 1 addition & 0 deletions tests/case1/github/snippets/cli-no-args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Proceeding without it -- expect the compliance to suffer.
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down
1 change: 1 addition & 0 deletions tests/case1/github/snippets/cli-with-nonexistent-path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer.
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down
5 changes: 5 additions & 0 deletions tests/case1/github/test_checker_no_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is False

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is False

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is False

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is False

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is False

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is False

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
1 change: 1 addition & 0 deletions tests/case1/gitlab/snippets/cli-no-args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Proceeding without it -- expect the compliance to suffer.
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down
1 change: 1 addition & 0 deletions tests/case1/gitlab/snippets/cli-with-nonexistent-path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer.
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down
5 changes: 5 additions & 0 deletions tests/case1/gitlab/test_checker_no_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is False

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is False

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is False

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is False

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is False

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is False

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
1 change: 1 addition & 0 deletions tests/case2/github/snippets/cli-no-args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ url: https://github.com/fair-software/repo1
(3/5) registry
✓ has_ascl_badge
✓ has_bintray_badge
✓ has_conan_badge
✓ has_conda_badge
✓ has_cran_badge
✓ has_crates_badge
Expand Down
1 change: 1 addition & 0 deletions tests/case2/github/snippets/cli-with-nonexistent-path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer.
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down
5 changes: 5 additions & 0 deletions tests/case2/github/test_checker_no_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is True

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is True

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is True

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is True

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is True

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is True

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
1 change: 1 addition & 0 deletions tests/case2/gitlab/snippets/cli-no-args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ url: https://gitlab.com/fair-software/repo1
(3/5) registry
✓ has_ascl_badge
✓ has_bintray_badge
✓ has_conan_badge
✓ has_conda_badge
✓ has_cran_badge
✓ has_crates_badge
Expand Down
1 change: 1 addition & 0 deletions tests/case2/gitlab/snippets/cli-with-nonexistent-path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer.
(3/5) registry
× has_ascl_badge
× has_bintray_badge
× has_conan_badge
× has_conda_badge
× has_cran_badge
× has_crates_badge
Expand Down
5 changes: 5 additions & 0 deletions tests/case2/gitlab/test_checker_no_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker):
checker = get_checker()
assert checker.has_codemeta_file() is True

def test_has_conan_badge(self, mocker):
with mocker:
checker = get_checker()
assert checker.has_conan_badge() is True

def test_has_conda_badge(self, mocker):
with mocker:
checker = get_checker()
Expand Down
2 changes: 2 additions & 0 deletions tests/case2/repo-files/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
:target: https://npmjs.org/package/cnpm
12. .. image:: https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green
:target: https://fair-software.eu
13. .. image:: https://img.shields.io/conan/v/vir-simd
:target: https://conan.io/center/recipes/vir-simd
4 changes: 4 additions & 0 deletions tests/contracts/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def test_has_citationcff_file(self, mocked_context: Mocker):
def test_has_codemeta_file(self, mocked_context: Mocker):
pass

@abstractmethod
def test_has_conan_badge(self, mocked_context: Mocker):
pass

@abstractmethod
def test_has_conda_badge(self, mocked_context: Mocker):
pass
Expand Down

0 comments on commit 0b3d4ad

Please sign in to comment.