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

Qiskit / ecosystem / 30112267123

24 Jul 2026 05:15PM UTC coverage: 70.346%. First build
30112267123

Pull #1262

github

web-flow
Merge 1e9d88550 into b2d9b9a92
Pull Request #1262: update psf-zero-qiskit labels

0 of 3 new or added lines in 1 file covered. (0.0%)

1931 of 2745 relevant lines covered (70.35%)

0.7 hits per line

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

25.45
/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
from . import ibm_controlled_gh_org
1✔
23

24

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

32

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

42

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

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

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

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

60

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

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

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

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

79

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

87

88
def test_G09(member):
1✔
NEW
89
    assert hasattr(member.github, "license"), "member.github.license does not exist"
×
90

NEW
91
    if member.github.license and str(member.github.license) in ["None", "Other"]:
×
92
        assert (
×
93
            member.github.license.license_name is not None
94
        ), "member.github.license not detected"
95
        assert (
×
96
            member.github.license.license_name != "Other"
97
        ), "member.github.license not detected"
98

99

100
def test_G10(member):
1✔
NEW
101
    if hasattr(member.github, "license"):
×
102
        if str(member.github.license) in ["None", "Other"]:
×
103
            pytest.skip("No member.github.license, already covered by [G09]")
×
104
        assert (
×
105
            member.github.license.is_osi_approved()
106
        ), "member.github.license is not OSI-approved"
107

108

109
def test_G11(member):
1✔
110
    """
111
    Unmaintaned projects should be archived when the repo is on an IBM-controlled organization"
112
    """
113
    if not hasattr(member, "github"):
×
114
        pytest.skip("member.github does not exist")
×
115
    if member.github.owner.lower() not in ibm_controlled_gh_org:
×
116
        pytest.skip("repository is on an IBM-controlled organization")
×
117
    archived = member.github.archived if hasattr(member.github, "archived") else False
×
118
    if archived:
×
119
        pytest.skip("project repository is already archived")
×
120
    if member.maturity in ["deprecated", "unmaintaned", "as-is"]:
×
121
        assert archived, (
×
122
            f"Unsupported project (`member.maturity == {member.maturity}`"
123
            "should have an archived GitHub repository"
124
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc