File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 15
15
# You should have received a copy of the GNU Lesser General Public License
16
16
# along with geoh5py. If not, see <https://www.gnu.org/licenses/>.
17
17
18
+ import re
18
19
from pathlib import Path
19
20
20
21
import toml
@@ -31,5 +32,15 @@ def get_version():
31
32
return pyproject ["tool" ]["poetry" ]["version" ]
32
33
33
34
34
- def test_version ():
35
+ def test_version_is_consistent ():
35
36
assert geoh5py .__version__ == get_version ()
37
+
38
+
39
+ def test_version_is_semver ():
40
+ semver_re = (
41
+ r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)"
42
+ r"(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)"
43
+ r"(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?"
44
+ r"(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
45
+ )
46
+ assert re .search (semver_re , geoh5py .__version__ ) is not None
You can’t perform that action at this time.
0 commit comments