Skip to content

Commit

Permalink
Add __version__ (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw authored Aug 17, 2023
1 parent 71aaf44 commit 7a6d89b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions polarify/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import ast
import importlib.metadata
import inspect
import warnings
from functools import wraps

from .main import parse_body, transform_tree_into_expr

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"


def transform_func_to_new_source(func) -> str:
source = inspect.getsource(func)
Expand Down

0 comments on commit 7a6d89b

Please sign in to comment.