def is_python_version_compatible(pyproject_data: dict) -> bool:
    """Check if the package is compatible with the current Python version using packaging."""
    # Get current Python version
    current_version = version.Version(
        f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
    )

    # Get Python version requirements if they exist
    requires_python = pyproject_data.get("project", {}).get("requires-python")
    if requires_python is None:
        # If no Python version is specified, assume it's compatible
        return True

    try:
        # Parse the version specifier
        spec = specifiers.SpecifierSet(requires_python)

        # Check if the current version satisfies the specifier
        return spec.contains(str(current_version))
    except Exception as e:
        # If there's any error in parsing, log it and assume compatibility
        print(
            f"Warning: Could not parse Python version specifier '{requires_python}': {e}"
        )
        return True
Check if the package is compatible with the current Python version using packaging.
llama-dev/llama_dev/utils.py