By moving __version__ to __init__.py, it becomes an attribute of the module. This is recommended in PEP 396 and a common practice in many contemporary packages. This enables the following: >>> import mypackage >>> print(mypackage.__version__) '5.2.0'
6 lines
97 B
Python
6 lines
97 B
Python
|
|
from .__version__ import VERSION
|
|
__version__ = '.'.join(map(str, VERSION))
|
|
|
|
from .core import *
|