Skip to content
Snippets Groups Projects
Commit 67f1d48a authored by Georges Racinet's avatar Georges Racinet
Browse files

heptapod package: made version string importable

The only immediate application is to test PEP440 compliance,
but the motivation was rather that it's now very easily done.
parent e82cdf38
No related branches found
No related tags found
No related merge requests found
Pipeline #23873 passed
Pipeline: hgitaly

#23874

    ......@@ -4,4 +4,6 @@
    # GNU General Public License version 2 or any later version.
    #
    # SPDX-License-Identifier: GPL-2.0-or-later
    from pathlib import Path
    from . import patch # noqa: F401
    ......@@ -7,1 +9,4 @@
    from . import patch # noqa: F401
    __version__ = ( # noqa: F401
    Path(__file__).with_name('VERSION').read_text().strip())
    # Copyright 2021 Georges Racinet <georges.racinet@octobus.net>
    #
    # This software may be used and distributed according to the terms of the
    # GNU General Public License version 2 or any later version.
    #
    # SPDX-License-Identifier: GPL-2.0-or-later
    try:
    from pkg_resources import packaging
    except ImportError: # pragma no cover
    # one day, `packaging` might not be vendored in `pkg_resources` any more
    import packaging
    import heptapod
    def test_package_version():
    # the Version class accepts only PEP440 compliant version strings
    packaging.version.Version(heptapod.__version__)
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment