Repository: jerryjliu/gpt_index
File: llama-dev/llama_dev/test/__init__.py (Python)

Code before:
                    _trim(debug, f"Error:\n{result['stderr']}"), style="warning"
                )
            else:
                console.print(f"❌ {package_name} failed")
                console.print(
                    _trim(debug, f"Error:\n{result['stderr']}"), style="error"
                )
                console.print(
                    _trim(debug, f"Output:\n{result['stdout']}"), style="info"
                )

    # Print summary
    failed = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] in (ResultStatus.TESTS_FAILED, ResultStatus.COVERAGE_FAILED)
    ]
    install_failed = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] == ResultStatus.INSTALL_FAILED
    ]
    skipped_no_tests = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] == ResultStatus.SKIPPED and "package has no tests" in r["stderr"]
    ]
    skipped_pyversion_incompatible = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] == ResultStatus.SKIPPED
        and "Not compatible with Python" in r["stderr"]
    ]

    if skipped_pyversion_incompatible:
        console.print(
            f"\n{len(skipped_pyversion_incompatible)} packages were skipped due to Python version incompatibility:"
        )
        for p in skipped_pyversion_incompatible:
            print(p)
    if skipped_no_tests:
        console.print(
            f"\n{len(skipped_no_tests)} packages were skipped because they have no tests:"
        )
        for p in skipped_no_tests:
            print(p)

    if install_failed:
        # Do not fail the CI if there was an installation problem: many packages cannot
        # be installed in the runners, something we should either fix or ignore.
        console.print(f"\n{len(install_failed)} packages could not be installed:")

Review comment (suggestion):
While this works, the root problem is that `ResultStatus.SKIPPED` is returned both when `if not package_has_tests(package_path):` and when `if not is_python_version_compatible(package_data):` at lines 284 and 294. 

If we replace `ResultStatus.SKIPPED` with two new statuses like `NO_TESTS` and `UNSUPPORTED_PYTHON_VER` (or something like this), this check would be more robust.

Code after:
                    f"⏭️ {package_name} skipped due to python version incompatibility"
                )
                console.print(
                    _trim(debug, f"Error:\n{result['stderr']}"), style="warning"
                )
            elif result["status"] == ResultStatus.NO_TESTS:
                console.print(f"⏭️ {package_name} skipped due to no tests")
                console.print(
                    _trim(debug, f"Error:\n{result['stderr']}"), style="warning"
                )
            else:
                console.print(f"❌ {package_name} failed")
                console.print(
                    _trim(debug, f"Error:\n{result['stderr']}"), style="error"
                )
                console.print(
                    _trim(debug, f"Output:\n{result['stdout']}"), style="info"
                )

    # Print summary
    failed = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] in (ResultStatus.TESTS_FAILED, ResultStatus.COVERAGE_FAILED)
    ]
    install_failed = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] == ResultStatus.INSTALL_FAILED
    ]
    skipped_no_tests = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] == ResultStatus.NO_TESTS
        and "package has no tests" in r["stderr"]
    ]
    skipped_pyversion_incompatible = [
        r["package"].relative_to(repo_root)
        for r in results
        if r["status"] == ResultStatus.UNSUPPORTED_PYTHON_VERSION
        and "Not compatible with Python" in r["stderr"]
    ]

    if skipped_pyversion_incompatible:
        console.print(
            f"\n{len(skipped_pyversion_incompatible)} packages were skipped due to Python version incompatibility:"
        )
        for p in skipped_pyversion_incompatible:
            print(p)
    if skipped_no_tests:
        console.print(