Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering',
]

Expand Down
10 changes: 7 additions & 3 deletions src/xoak/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from pkg_resources import DistributionNotFound, get_distribution
try:
from importlib.metadata import version, PackageNotFoundError
except ImportError:
# Python < 3.8
from importlib_metadata import version, PackageNotFoundError

from .accessor import XoakAccessor
from .index import IndexAdapter, IndexRegistry

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound: # pragma: no cover
__version__ = version(__name__)
except PackageNotFoundError: # pragma: no cover
# package is not installed
pass