This adds `pytest.version_tuple`, which makes it simpler for users to do something depending on the pytest version, such as declaring hooks which are introduced in later versions. This feature was added originally in https://github.com/pypa/setuptools_scm/pull/475. Followup to https://github.com/pytest-dev/pytest/pull/7605.
10 lines
356 B
Python
10 lines
356 B
Python
__all__ = ["__version__", "version_tuple"]
|
|
|
|
try:
|
|
from ._version import version as __version__, version_tuple
|
|
except ImportError: # pragma: no cover
|
|
# broken installation, we don't even try
|
|
# unknown only works because we do poor mans version compare
|
|
__version__ = "unknown"
|
|
version_tuple = (0, 0, "unknown") # type:ignore[assignment]
|