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

Qiskit / ecosystem / 29353420687

14 Jul 2026 05:21PM UTC coverage: 70.846%. First build
29353420687

Pull #1237

github

web-flow
Merge 1e92d85b6 into 025aa7890
Pull Request #1237: check for repo activity and last commit

19 of 37 new or added lines in 9 files covered. (51.35%)

1927 of 2720 relevant lines covered (70.85%)

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?"""
33
    if hasattr(member.github, "archived") and member.github.archived:
×
34
        assert hasattr(
×
35
            member, "maturity"
36
        ), "GitHub repository archived, so member.maturity must exist and be `as-is`"
37
        assert member.maturity in [
×
38
            "as-is",
39
            "unmaintaned",
40
        ], "GitHub repository archived and member.maturity is not `as-is` or `unmaintaned`"
41

42

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

NEW
48
    last_activity = member.github.last_activity
×
NEW
49
    if last_activity is None:
×
NEW
50
        pytest.skip("No member.github.last_activity date")
×
51

NEW
52
    relative = relativedelta(date.today(), last_activity)
×
NEW
53
    months_difference = (relative.years * 12) + relative.months
×
54

NEW
55
    assert months_difference <= 6, (
×
56
        f"Last activity was {months_difference} months ago, which is more "
57
        "than 6 months ago. Please update the GitHub repository or set "
58
        "member.maturity to `as-is`."
59
    )
60

61

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

NEW
67
    last_commit = member.github.last_commit
×
NEW
68
    if last_commit is None:
×
NEW
69
        pytest.skip("No member.github.last_commit date")
×
70

NEW
71
    relative = relativedelta(date.today(), last_commit)
×
NEW
72
    months_difference = (relative.years * 12) + relative.months
×
73

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

80

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

88

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

98

99
def test_G10(member):
1✔
100
    if member.github.license:
×
101
        if str(member.github.license) in ["None", "Other"]:
×
102
            pytest.skip("No member.github.license, already covered by [G09]")
×
103
        assert (
×
104
            member.github.license.is_osi_approved()
105
        ), "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