INNER CODE UNIT · Python

OQS_ERROR

open-quantum-safe/liboqs-python · oqs/oqs.py:67

OQS_ERROR: Final[int] = -1


def oqs_python_version() -> Union[str, None]:
    """liboqs-python version string."""
    try:
        result = importlib.metadata.version("liboqs-python")
    except importlib.metadata.PackageNotFoundError:
        warnings.warn("Please install liboqs-python using pip install", stacklevel=2)
        pyproject = Path(__file__).resolve().parent.parent / "pyproject.toml"
        try:
            # Fallback to version specified in pyproject.toml when running from the
            # source tree. This allows workflows to use the correct liboqs version
            # before the package is installed.
            with pyproject.open("rb") as f:
                data = tomllib.load(f)
            return data["project"]["version"]
        except (FileNotFoundError, KeyError, tomllib.TOMLDecodeError):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…