File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
2+ # Copyright (c) 2024-2025 Mira Geoscience Ltd. '
3+ # '
4+ # This file is part of mirageoscience.pre-commit-hooks package. '
5+ # '
6+ # mirageoscience.pre-commit-hooks is distributed under the terms and conditions '
7+ # of the MIT License (see LICENSE file at the root of this source code package). '
8+ # '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
9+
10+ from __future__ import annotations
11+
12+ from pathlib import Path
13+
14+ import tomli as toml
15+ from packaging .version import Version
16+
17+ from mirageoscience import hooks as mira_hooks
18+
19+
20+ def get_pyproject_version ():
21+ path = Path (__file__ ).resolve ().parents [1 ] / "pyproject.toml"
22+
23+ with open (str (path ), encoding = "utf-8" ) as file :
24+ pyproject = toml .loads (file .read ())
25+
26+ return pyproject ["tool" ]["poetry" ]["version" ]
27+
28+
29+ def test_version_is_consistent ():
30+ assert mira_hooks .__version__ == get_pyproject_version ()
31+
32+
33+ def test_version_is_pep440 ():
34+ version = Version (mira_hooks .__version__ )
35+ assert version is not None
You can’t perform that action at this time.
0 commit comments