Skip to content

Commit

Permalink
dynamically set version
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbe7a committed May 23, 2024
1 parent 1c85ebf commit 771331e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion multiregex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

import collections
import functools
import importlib
import re
import warnings

try:
sre_constants = re._constants # type: ignore
Expand All @@ -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")
Expand Down

0 comments on commit 771331e

Please sign in to comment.