Skip to content

Commit 4318c05

Browse files
[CI/Build] Remove imports of built-in re (#18750)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
1 parent a68e293 commit 4318c05

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ repos:
142142
language: python
143143
types: [python]
144144
pass_filenames: false
145+
additional_dependencies: [regex]
145146
# Keep `suggestion` last
146147
- id: suggestion
147148
name: Suggestion

docs/mkdocs/hooks/generate_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# SPDX-License-Identifier: Apache-2.0
2-
32
import itertools
4-
import re
53
from dataclasses import dataclass, field
64
from pathlib import Path
75
from typing import Literal
86

7+
import regex as re
8+
99
ROOT_DIR = Path(__file__).parent.parent.parent.parent
1010
ROOT_DIR_RELATIVE = '../../../../..'
1111
EXAMPLE_DIR = ROOT_DIR / "examples"

docs/mkdocs/hooks/url_schemes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
2-
import re
3-
2+
import regex as re
43
from mkdocs.config.defaults import MkDocsConfig
54
from mkdocs.structure.files import Files
65
from mkdocs.structure.pages import Page

requirements/docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ mkdocstrings-python
55
mkdocs-gen-files
66
mkdocs-awesome-nav
77
python-markdown-math
8+
regex
89
ruff

tools/check_triton_import.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# SPDX-License-Identifier: Apache-2.0
2-
import re
32
import subprocess
43
import sys
54

5+
import regex as re
6+
67
FORBIDDEN_IMPORT_RE = re.compile(r"^(from|import)\s+triton(\s|\.|$)")
78

89
# the way allowed to import triton

vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# SPDX-License-Identifier: Apache-2.0
2-
32
import ast
43
import json
5-
import re
64
from collections.abc import Sequence
75
from typing import Any, Union
86

7+
import regex as re
98
from transformers import PreTrainedTokenizerBase
109

1110
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,

vllm/model_executor/guided_decoding/guidance_decoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# SPDX-License-Identifier: Apache-2.0
22
import json
3-
from re import escape as regex_escape
43

54
import llguidance
5+
from regex import escape as regex_escape
66
from transformers import PreTrainedTokenizerBase
77

88
from vllm.model_executor.guided_decoding.guidance_logits_processors import (

vllm/model_executor/guided_decoding/outlines_decoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import os
66
from enum import Enum
77
from json import dumps as json_dumps
8-
from re import escape as regex_escape
98
from typing import Optional, Union
109

10+
from regex import escape as regex_escape
1111
from transformers import PreTrainedTokenizerBase
1212

1313
from vllm.model_executor.guided_decoding.outlines_logits_processors import (

0 commit comments

Comments
 (0)