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 3af479f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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 3af479f

Please sign in to comment.