From 8a8e2106d6fd9293287b38641b98014da4611ffd Mon Sep 17 00:00:00 2001 From: majiayu000 <1835304752@qq.com> Date: Sun, 28 Dec 2025 01:55:05 +0800 Subject: [PATCH] fix(deps): add peft version constraint to avoid 0.18 incompatibility Pin peft to >=0.11.0,<0.18.0 to avoid breaking changes introduced in peft 0.18.0 which is incompatible with the current codebase. Fixes #1546 Signed-off-by: majiayu000 <1835304752@qq.com> --- setup.py | 2 +- tests/__init__.py | 0 tests/test_dependencies.py | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/__init__.py create mode 100644 tests/test_dependencies.py diff --git a/setup.py b/setup.py index e72e4d36..53d79ac6 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ 'datasets>=2.19.0', 'accelerate>=0.20.1', 'sentence_transformers', - 'peft', + 'peft>=0.11.0,<0.18.0', 'ir-datasets', 'sentencepiece', 'protobuf' diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_dependencies.py b/tests/test_dependencies.py new file mode 100644 index 00000000..08c67837 --- /dev/null +++ b/tests/test_dependencies.py @@ -0,0 +1,21 @@ +"""Test dependency version constraints.""" + +import ast +import os + + +def test_peft_version_constraint(): + """Test that peft has proper version constraint in setup.py.""" + setup_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "setup.py") + + with open(setup_path, "r") as f: + content = f.read() + + # Check that peft has version constraints + assert "peft>=" in content, "peft should have a minimum version constraint" + assert "peft" in content and "<0.18" in content, "peft should have an upper bound < 0.18" + + +if __name__ == "__main__": + test_peft_version_constraint() + print("Dependency version constraint test passed!")