• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / ecosystem / 29663504740

18 Jul 2026 10:28PM UTC coverage: 70.716%. First build
29663504740

Pull #1250

github

web-flow
Merge 91e1cfd79 into 2e41a9e8a
Pull Request #1250: update_status can exclude recommendations

1 of 9 new or added lines in 2 files covered. (11.11%)

1927 of 2725 relevant lines covered (70.72%)

0.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

27.91
/ecosystem/validation/test_github.py
1
# This code is part of Qiskit.
2
#
3
# (C) Copyright IBM 2023.
4
#
5
# This code is licensed under the Apache License, Version 2.0. You may
6
# obtain a copy of this license in the LICENSE.txt file in the root directory
7
# of this source tree or at https://www.apache.org/licenses/LICENSE-2.0.
8
#
9
# Any modifications or derivative works of this code must retain this
10
# copyright notice, and modified files need to carry a notice indicating
11
# that they have been altered from the originals.
12

13
"""Validations involving section member.github"""
1✔
14

15
# pylint: disable=invalid-name,missing-function-docstring
16

17
from datetime import date
1✔
18
from dateutil.relativedelta import relativedelta
1✔
19

20
import pytest
1✔
21

22

23
@pytest.fixture(autouse=True)
1✔
24
def skip_github(member):
1✔
25
    """Skip if no github section"""
26
    if member.github is None:
×
27
        pytest.skip("No github section")
×
28
    yield member
×
29

30

31
def test_G05(member):
1✔
32
    """GitHub repository is archived?"""
NEW
33
    if hasattr(member, "maturity") and member.maturity == "as-is":
×
NEW
34
        pytest.skip("`as-is` projects are exempt from activity checks")
×
35
    else:
NEW
36
        assert not (
×
37
            hasattr(member.github, "archived") and member.github.archived
38
        ), "GitHub repository archived"
39

40

41
def test_G06(member):
1✔
42
    """Have maintainer activity within the last 6 months"""
43
    if member.maturity == "as-is":
×
44
        pytest.skip("`as-is` projects are exempt from activity checks")
×
45

46
    last_activity = member.github.last_activity
×
47
    if last_activity is None:
×
48
        pytest.skip("No member.github.last_activity date")
×
49

50
    relative = relativedelta(date.today(), last_activity)
×
51
    months_difference = (relative.years * 12) + relative.months
×
52

53
    assert months_difference <= 6, (
×
54
        f"Last activity was {months_difference} months ago, which probably means that the project "
55
        "is not actively maintained and/or used. Maybe `member.maturity` should be set as `as-is`?"
56
    )
57

58

59
def test_G07(member):
1✔
60
    """Have last commit within the last 18 months"""
61
    if member.maturity == "as-is":
×
62
        pytest.skip("`as-is` projects are exempt from activity checks")
×
63

64
    last_commit = member.github.last_commit
×
65
    if last_commit is None:
×
66
        pytest.skip("No member.github.last_commit date")
×
67

68
    relative = relativedelta(date.today(), last_commit)
×
69
    months_difference = (relative.years * 12) + relative.months
×
70

71
    assert months_difference <= 18, (
×
72
        f"Last commit was {months_difference} months ago, which is more "
73
        "than 18 months ago. Please update the GitHub repository or set "
74
        "member.maturity to `as-is`."
75
    )
76

77

78
def test_G08(member):
1✔
79
    """Unmaintaned projects should archive their GitHub repository"""
80
    if member.maturity in ["deprecated", "unmaintaned"]:
×
81
        assert (
×
82
            member.github.archived
83
        ), "unsupported project should have an archived GitHub org"
84

85

86
def test_G09(member):
1✔
87
    if str(member.github.license) in ["None", "Other"]:
×
88
        assert (
×
89
            member.github.license.license_name is not None
90
        ), "member.github.license not detected"
91
        assert (
×
92
            member.github.license.license_name != "Other"
93
        ), "member.github.license not detected"
94

95

96
def test_G10(member):
1✔
97
    if member.github.license:
×
98
        if str(member.github.license) in ["None", "Other"]:
×
99
            pytest.skip("No member.github.license, already covered by [G09]")
×
100
        assert (
×
101
            member.github.license.is_osi_approved()
102
        ), "member.github.license is not OSI-approved"
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc