Skip to content

Commit b6a3485

Browse files
authored
fix: compare version to SKBUILD properly (#314)
As seen in trying a pre0 release candidate
1 parent 4143ec0 commit b6a3485

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_binding.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import correctionlib
99
import correctionlib.schemav2 as cs
10+
import correctionlib.version
1011

1112

1213
@pytest.fixture(scope="module")
@@ -90,7 +91,8 @@ def test_cmake_static_compilation(csetstr: str):
9091
f.write(CMAKELIST_SRC)
9192
testprog = os.path.join(tmpdir, "test.cc")
9293
# SKBUILD_PROJECT_VERSION only includes major.minor.patch
93-
versionstr = ".".join(correctionlib.__version__.split(".")[:3])
94+
# it also trims any prerelease suffixes
95+
versionstr = ".".join(map(str, correctionlib.version.__version_tuple__[:3]))
9496
with open(testprog, "w") as f:
9597
f.write(TESTPROG_SRC % (versionstr, csetstr))
9698
flags = (

0 commit comments

Comments
 (0)