Skip to content

Commit a1d68cf

Browse files
committed
Added version information to package
1 parent d1af191 commit a1d68cf

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

utilitiez/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1-
"""Various useful tools that we developed.
1+
"""Various useful tools that we developed in the Zwicker Group.
22
33
.. codeauthor:: David Zwicker <[email protected]>
44
"""
55

6+
# determine the package version
7+
try:
8+
# try reading version of the automatically generated module
9+
from ._version import __version__
10+
except ImportError:
11+
# determine version automatically from CVS information
12+
from importlib.metadata import PackageNotFoundError, version
13+
14+
try:
15+
__version__ = version("utilitiez")
16+
except PackageNotFoundError:
17+
# package is not installed, so we cannot determine any version
18+
__version__ = "unknown"
19+
del PackageNotFoundError, version # clean name space
20+
21+
# import the functions provided by the package
622
from .densityplot import densityplot
723
from .mathematics import *

0 commit comments

Comments
 (0)