Skip to content

Commit

Permalink
Add __version__ to the package (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab authored Oct 12, 2021
1 parent 0508e47 commit f0f5fc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ibis_omniscidb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import warnings
from importlib.metadata import PackageNotFoundError, version
from typing import Optional, Union

import ibis.common.exceptions as com
Expand All @@ -24,12 +25,18 @@
from .compiler import OmniSciDBCompiler
from .udf import OmniSciDBUDF

try:
__version__ = version("ibis_omniscidb")
except PackageNotFoundError:
__version__ = ""


try:
from cudf import DataFrame as GPUDataFrame
except (ImportError, OSError):
GPUDataFrame = None

__all__ = ('Backend',)
__all__ = ('Backend', "__version__")


class Backend(BaseSQLBackend):
Expand Down
4 changes: 4 additions & 0 deletions ibis_omniscidb/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,7 @@ def test_current_database(con):
def test_list_databases(con):
assert 'ibis_testing' in con.list_databases()
assert 'ibis_testing' in con.list_databases(like='ibis.*')


def test_version():
assert ibis_omniscidb.__version__

0 comments on commit f0f5fc9

Please sign in to comment.