import re
from pathlib import Path


def get_version() -> str:
    """Get version string from slipbox/__init__.py."""
    pattern = re.compile(r'__version__ = "(.+)"')
    init = Path(__file__).with_name("slipbox")/"__init__.py"
    result = pattern.search(init.read_text())

    assert result
    return result.groups()[0]