Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds `pytest.version_tuple`, which makes it simpler for users to do something depending on the pytest version (such as declaring plugins which are introduced in later versions) more easily than parsing the version themselves. This feature was added originally in pypa/setuptools_scm#475. Followup to #7605.
- Loading branch information
1 parent
6447ca5
commit ed2fd1b
Showing
4 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
__all__ = ["__version__"] | ||
__all__ = ["__version__", "version_tuple"] | ||
|
||
try: | ||
from ._version import version as __version__ | ||
from ._version import version as __version__, version_tuple | ||
except ImportError: | ||
# 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters