Skip to content

Commit

Permalink
Make package useable when it is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Jun 28, 2021
1 parent 65857ef commit 9a96282
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion delta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
Stylometrics in Python
"""
import warnings

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError: # < Python 3.8
import importlib_metadata

__title__ = 'delta'
__version__ = importlib_metadata.version(__name__)
try:
__version__ = importlib_metadata.version(__name__)
except Exception as e:
__version__ = None
warnings.warn(f'Could not determine version: {e}', ImportWarning, source=e)
__author__ = 'Fotis Jannidis, Thorsten Vitt'

from warnings import warn
Expand Down

0 comments on commit 9a96282

Please sign in to comment.