Skip to content

Commit

Permalink
Provide __version__ of the package (#279)
Browse files Browse the repository at this point in the history
Provide __version__ of the package

So it can be easily checked when installed on the system.

Reviewed-by: Matej Focko
  • Loading branch information
softwarefactory-project-zuul[bot] authored Oct 30, 2023
2 parents dc253f9 + f07cdec commit 551358e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions requre/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT

import contextlib
from importlib.metadata import PackageNotFoundError, distribution

from requre.base_testclass import RequreTestCase
from requre.record_and_replace import record, replace
from requre.cassette import Cassette
Expand All @@ -9,6 +12,9 @@
from requre.helpers.files import StoreFiles
from requre.import_system import UpgradeImportSystem

with contextlib.suppress(PackageNotFoundError):
__version__ = distribution(__name__).version

__all__ = [
record.__name__,
replace.__name__,
Expand Down

0 comments on commit 551358e

Please sign in to comment.