diff --git a/README.md b/README.md index 69e291d..ecb3c7f 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ See [this introductory blog post](https://tech.quantco.com/2022/07/31/multiregex You can install the package in development mode using: ```bash -git clone https://github.com/quantco/coarse_regression -cd coarse-regression +git clone https://github.com/quantco/multiregex +cd multiregex pixi run pre-commit-install pixi run postinstall diff --git a/multiregex/__init__.py b/multiregex/__init__.py index ca4a720..29ddf08 100644 --- a/multiregex/__init__.py +++ b/multiregex/__init__.py @@ -20,7 +20,9 @@ import collections import functools +import importlib import re +import warnings try: sre_constants = re._constants # type: ignore @@ -43,7 +45,12 @@ import ahocorasick -__version__ = "2.0.0" +try: + __version__ = importlib.metadata.version(__name__) +except importlib.metadata.PackageNotFoundError as e: + warnings.warn(f"Could not determine version of {__name__}", stacklevel=1) + warnings.warn(str(e), stacklevel=1) + __version__ = "unknown" V = TypeVar("V")