Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide __version__ of the package #279

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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