Skip to content

Commit

Permalink
Add test to check binder and llvm versions
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiliin committed Jun 23, 2024
1 parent 9c348ce commit 0e6a79e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ version = "${version}"

[tool.cibuildwheel]
build = "cp312-*"
test-requires = ["pytest", "packaging"]
test-command = "pytest {package}/tests"
musllinux-x86_64-image = "musllinux_1_1"
musllinux-i686-image = "musllinux_1_1"
musllinux-aarch64-image = "musllinux_1_1"
Expand Down
17 changes: 17 additions & 0 deletions python/tests/test_binder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import re
import subprocess

from binder import __version__
from packaging.version import Version


def test_check_binder_llvm_version():
# Check the output of the `binder -version` command to obtain the versions of Binder and LLVM
output = subprocess.check_output(["binder", "-version"]).decode()
pattern = r"binder ([\d\.]+)\nLLVM ([\d\.]+)"
binder_version, llvm_version = re.match(pattern, output).groups()

# Check the versions of Binder and LLVM
binder_base_version = Version(__version__).base_version
assert binder_base_version == binder_version, f"Binder version mismatch: {binder_base_version} != {binder_version}"
assert llvm_version == "6.0.1", f"LLVM version mismatch: {llvm_version} != 6.0.1"

0 comments on commit 0e6a79e

Please sign in to comment.