# HG changeset patch # User Franz Glasner # Date 1607329853 -3600 # Node ID ffcce6062bee4a7f06cbbda1eb4895f867d6bea2 # Parent c06e438f68b2662e778a57bb84d4066958c9f1e3 Put the version number info the optinal common module _cutils.py diff -r c06e438f68b2 -r ffcce6062bee _cutils.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/_cutils.py Mon Dec 07 09:30:53 2020 +0100 @@ -0,0 +1,15 @@ +r""" +:Author: Franz Glasner +:Copyright: (c) 2020 Franz Glasner. + All rights reserved. +:License: BSD 3-Clause "New" or "Revised" License. + See :ref:`LICENSE ` for details. + If you cannot find LICENSE see + +:ID: @(#) $HGid$ + +""" + +__version__ = "0.1" + +__all__ = ["__version__"] diff -r c06e438f68b2 -r ffcce6062bee setup.py --- a/setup.py Mon Dec 07 03:10:44 2020 +0100 +++ b/setup.py Mon Dec 07 09:30:53 2020 +0100 @@ -20,7 +20,7 @@ _version_re = re.compile(br"^\s*__version__\s*=\s*(\"|')(.*)\1\s*(#.*)?$", re.MULTILINE) -with open(os.path.join(pkg_root, "shasum.py"), "rb") as vf: +with open(os.path.join(pkg_root, "_cutils.py"), "rb") as vf: version = _version_re.search(vf.read()).group(2).decode("utf-8") @@ -32,7 +32,8 @@ url="https://pypi.dom66.de/simple/py-cutils/", description="Pure Python implementation of some coreutils", long_description="Pure Python implementation of some coreutils", - py_modules=["shasum"], + py_modules=["_cutils", + "shasum",], include_package_data=False, zip_safe=True, platforms="any", diff -r c06e438f68b2 -r ffcce6062bee shasum.py --- a/shasum.py Mon Dec 07 03:10:44 2020 +0100 +++ b/shasum.py Mon Dec 07 09:30:53 2020 +0100 @@ -13,7 +13,10 @@ from __future__ import print_function -__version__ = "0.1" +try: + from _cutils import __version__ +except ImportError: + __version__ = "unknown" __revision__ = "|VCSRevision|" __date__ = "|VCSJustDate|"