package version section

This commit is contained in:
2024-04-26 22:07:18 +02:00
parent 51b5c67e46
commit 8a9a50346d
6 changed files with 99 additions and 32 deletions

View File

@@ -4,6 +4,19 @@
Fancy numerics made easy.
"""
__version__ = '1.4.2'
""" Current version of the numerix package as string 'x.y.z'. """
__year__ = '2024'
""" Year of the current numerix version as string. """
# Add them to documentation:
__pdoc__ = {}
__pdoc__['__version__'] = True
__pdoc__['__year__'] = True
# Functions defined directly in __init__.py can be imported directly
# from the package (e.g. from numerix import add_four):
def add_four(x):
@@ -25,4 +38,3 @@ def add_four(x):
# Functions from the modules of the package can be imported into the
# namespace of the package:
from .addition import add_two
from .version import __version__

View File

@@ -1,6 +1,2 @@
def add_two(x):
return x + 2

View File

@@ -1,5 +1,11 @@
from .__init__ import __version__
from .addition import add_two
def three():
return add_two(1)
def about():
print(f'{__name__} {__version__}')

View File

@@ -1,14 +0,0 @@
""" Version and year of the numerix package.
"""
__version__ = '1.4.2'
""" Current version of the numerix package as string 'x.y.z'. """
__year__ = '2024'
""" Year of the current numerix version as string. """
# Add them to documentation:
__pdoc__ = {}
__pdoc__['__version__'] = True
__pdoc__['__year__'] = True