Browse Source

Programatically obtain the package version

Closes: PYADPT-96
PYADPT-96_init_version
juga 5 years ago
parent
commit
1004856abe
  1. 6
      src/pEp/__init__.py

6
src/pEp/__init__.py

@ -2,6 +2,12 @@
# This file is being exectued upon 'import pEp' # This file is being exectued upon 'import pEp'
# #
# __all__ could be used to limit the symbols exported when using from <pkg> import * # __all__ could be used to limit the symbols exported when using from <pkg> import *
from pkg_resources import DistributionNotFound, get_distribution
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
print("Package is not installed.")
# Import all symbols EXCEPT the ones beginning with underscore into the current namespace # Import all symbols EXCEPT the ones beginning with underscore into the current namespace

Loading…
Cancel
Save