Skip to content

[CI/Build] Remove imports of built-in re #18750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ repos:
language: python
types: [python]
pass_filenames: false
additional_dependencies: [regex]
# Keep `suggestion` last
- id: suggestion
name: Suggestion
Expand Down
4 changes: 2 additions & 2 deletions docs/mkdocs/hooks/generate_examples.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-License-Identifier: Apache-2.0

import itertools
import re
from dataclasses import dataclass, field
from pathlib import Path
from typing import Literal

import regex as re

ROOT_DIR = Path(__file__).parent.parent.parent.parent
ROOT_DIR_RELATIVE = '../../../../..'
EXAMPLE_DIR = ROOT_DIR / "examples"
Expand Down
3 changes: 1 addition & 2 deletions docs/mkdocs/hooks/url_schemes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import re

import regex as re
from mkdocs.config.defaults import MkDocsConfig
from mkdocs.structure.files import Files
from mkdocs.structure.pages import Page
Expand Down
1 change: 1 addition & 0 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mkdocstrings-python
mkdocs-gen-files
mkdocs-awesome-nav
python-markdown-math
regex
ruff
3 changes: 2 additions & 1 deletion tools/check_triton_import.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SPDX-License-Identifier: Apache-2.0
import re
import subprocess
import sys

import regex as re

FORBIDDEN_IMPORT_RE = re.compile(r"^(from|import)\s+triton(\s|\.|$)")

# the way allowed to import triton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

import ast
import json
import re
from collections.abc import Sequence
from typing import Any, Union

import regex as re
from transformers import PreTrainedTokenizerBase

from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
Expand Down
2 changes: 1 addition & 1 deletion vllm/model_executor/guided_decoding/guidance_decoding.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
import json
from re import escape as regex_escape

import llguidance
from regex import escape as regex_escape
from transformers import PreTrainedTokenizerBase

from vllm.model_executor.guided_decoding.guidance_logits_processors import (
Expand Down
2 changes: 1 addition & 1 deletion vllm/model_executor/guided_decoding/outlines_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import os
from enum import Enum
from json import dumps as json_dumps
from re import escape as regex_escape
from typing import Optional, Union

from regex import escape as regex_escape
from transformers import PreTrainedTokenizerBase

from vllm.model_executor.guided_decoding.outlines_logits_processors import (
Expand Down