refactor(workflow): move variables package into core.workflow (#32750)

This commit is contained in:
-LAN-
2026-03-01 03:15:09 +08:00
committed by GitHub
parent 962df17a15
commit 1f0fca89a8
104 changed files with 201 additions and 245 deletions
@@ -3,7 +3,10 @@ import dataclasses
from pydantic import BaseModel
from core.helper import encrypter
from core.variables.segments import (
from core.workflow.file import File, FileTransferMethod, FileType
from core.workflow.runtime import VariablePool
from core.workflow.system_variable import SystemVariable
from core.workflow.variables.segments import (
ArrayAnySegment,
ArrayFileSegment,
ArrayNumberSegment,
@@ -19,8 +22,8 @@ from core.variables.segments import (
StringSegment,
get_segment_discriminator,
)
from core.variables.types import SegmentType
from core.variables.variables import (
from core.workflow.variables.types import SegmentType
from core.workflow.variables.variables import (
ArrayAnyVariable,
ArrayFileVariable,
ArrayNumberVariable,
@@ -35,9 +38,6 @@ from core.variables.variables import (
StringVariable,
Variable,
)
from core.workflow.file import File, FileTransferMethod, FileType
from core.workflow.runtime import VariablePool
from core.workflow.system_variable import SystemVariable
def test_segment_group_to_text():
@@ -1,6 +1,6 @@
import pytest
from core.variables.types import ArrayValidation, SegmentType
from core.workflow.variables.types import ArrayValidation, SegmentType
class TestSegmentTypeIsArrayType:
@@ -10,8 +10,10 @@ from typing import Any
import pytest
from core.variables.segment_group import SegmentGroup
from core.variables.segments import (
from core.workflow.file.enums import FileTransferMethod, FileType
from core.workflow.file.models import File
from core.workflow.variables.segment_group import SegmentGroup
from core.workflow.variables.segments import (
ArrayFileSegment,
BooleanSegment,
FileSegment,
@@ -20,9 +22,7 @@ from core.variables.segments import (
ObjectSegment,
StringSegment,
)
from core.variables.types import ArrayValidation, SegmentType
from core.workflow.file.enums import FileTransferMethod, FileType
from core.workflow.file.models import File
from core.workflow.variables.types import ArrayValidation, SegmentType
def create_test_file(
@@ -1,7 +1,7 @@
import pytest
from pydantic import ValidationError
from core.variables import (
from core.workflow.variables import (
ArrayFileVariable,
ArrayVariable,
FloatVariable,
@@ -11,7 +11,7 @@ from core.variables import (
SegmentType,
StringVariable,
)
from core.variables.variables import VariableBase
from core.workflow.variables.variables import VariableBase
def test_frozen_variables():