Skip to content

Commit 0a7a21e

Browse files
committed
Add tests to remind us of removing deprecated compatibility code
Signed-off-by: Max de Bayser <[email protected]>
1 parent 30cb893 commit 0a7a21e

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- name: "worker and utils"
5151
markers: "not e2e"
5252
flags: "--timeout=300"
53+
- name: "compatibility"
54+
markers: "compat"
55+
flags: "--timeout=300"
5356

5457
name: "${{ matrix.test_suite.name }} (${{ matrix.vllm_version.name }})"
5558

@@ -90,6 +93,7 @@ jobs:
9093
if: (steps.changed-src-files.outputs.any_changed == 'true' && matrix.vllm_version.repo)
9194
run: |
9295
uv add ${{ matrix.vllm_version.repo }}
96+
echo "TEST_VLLM_VERSION=main" >> $GITHUB_ENV
9397
9498
- name: "Install vLLM with Spyre plugin"
9599
if: steps.changed-src-files.outputs.any_changed == 'true'

tests/utils/upstream_compatibility.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import os
2+
3+
import pytest
4+
5+
pytestmark = pytest.mark.compat
6+
7+
VLLM_VERSION = os.getenv("TEST_VLLM_VERSION", "default")
8+
9+
10+
def test_vllm_bert_support(monkeypatch):
11+
'''
12+
Test if the vllm version under test already has Bert support for V1
13+
'''
14+
15+
from vllm.model_executor.models.bert import BertEmbeddingModel
16+
from vllm.model_executor.models.interfaces import SupportsV0Only
17+
18+
bert_supports_v0_only = issubclass(BertEmbeddingModel, SupportsV0Only)
19+
20+
if VLLM_VERSION == "main":
21+
assert not bert_supports_v0_only
22+
else:
23+
assert bert_supports_v0_only, (
24+
"The currently supported vLLM version already"
25+
"supports Bert in V1. Remove the compatibility workarounds.")

vllm_spyre/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def device_type(cls):
7474
from vllm.config import ModelConfig
7575

7676
# no need to patch after the model_config change
77-
if not 'model_config' in \
77+
if 'model_config' not in \
7878
inspect.getfullargspec(ModelConfig.is_v1_compatible).args:
7979
ModelConfig.is_v1_compatible = is_v1_compatible
8080
return cls._device_type

0 commit comments

Comments
 (0)