diff --git a/ecosystem/validation/test_pypi.py b/ecosystem/validation/test_pypi.py index c3c4c84b4f..877a5c8901 100644 --- a/ecosystem/validation/test_pypi.py +++ b/ecosystem/validation/test_pypi.py @@ -12,7 +12,7 @@ """Validations involving section member.pypi""" -# pylint: disable=invalid-name +# pylint: disable=invalid-name,missing-function-docstring import pytest @@ -75,3 +75,11 @@ def test_P11(member): assert ( len(stable_packages) != 0 ), "At least one python package should declare a stable development status classifier" + + +def test_P12(member): + for pypi_package in member.pypi.values(): + assert pypi_package.compatible_with_qiskit(3), ( + f"Python package {pypi_package.package_name} declared " + "itself compatible with a not-yet-released major version of Qiskit" + ) diff --git a/resources/checks.toml b/resources/checks.toml index 90be360e9c..d0233e4b1d 100644 --- a/resources/checks.toml +++ b/resources/checks.toml @@ -242,6 +242,15 @@ description = "If the project maturiy level is is production-ready then, at leas checker = "test_pypi.py::test_P11" importance = "STRONG-RECOMMENDATION" +[P12] +title = "Have a cap on the major version for the qiskit dependency" +applies_to = "Python packages" +affects = ['member.pypi.*.requires_qiskit'] +category = "BEST-PRACTICE" +description = "As Qiskit follows semantic versioning, not having a cap for the eventual next major version, there is no guarantee that the package will continue working as expected." +checker = "test_pypi.py::test_P12" +importance = "RECOMMENDATION" + [020] title = "Primitive interface should be v2-compatible" applies_to = 'label:"Compute provider"' @@ -302,3 +311,7 @@ description = "There is an issue with some of the open-source aspect of the proj [[categories]] name = "OUT-OF-DATE" description = "The project might not follow the last best-practices or connects to Qiskit in a way that is considered old-fashioned, currently unsupported, or deprecated." + +[[categories]] +name = "BEST-PRACTICE" +description = "The project might not follow software general best-practices."