Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ jobs:

uv lock
cd src/backend/base && uv lock && cd ../../..
cd src/lfx && uv lock && cd ../..
cd src/core && uv lock && cd ../..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add src/core/uv.lock to the commit.

You run uv lock inside src/core but don’t stage src/core/uv.lock. This can desync the committed lockfiles.

Apply:

-          git add pyproject.toml src/backend/base/pyproject.toml src/core/pyproject.toml uv.lock src/backend/base/uv.lock
+          git add pyproject.toml src/backend/base/pyproject.toml src/core/pyproject.toml uv.lock src/backend/base/uv.lock src/core/uv.lock

Also applies to: 94-95

🤖 Prompt for AI Agents
In .github/workflows/nightly_build.yml around lines 92-93 (and similarly at
94-95), the workflow runs "uv lock" in src/core but never stages or commits
src/core/uv.lock; update the workflow to git-add and commit the generated
src/core/uv.lock after running uv lock (e.g., run git add src/core/uv.lock and
git commit -m "chore: update src/core/uv.lock" or conditionally commit if
changes exist), ensuring the lockfile is included in the repo so committed
lockfiles stay in sync.

git add pyproject.toml src/backend/base/pyproject.toml src/lfx/pyproject.toml uv.lock src/backend/base/uv.lock
git add pyproject.toml src/backend/base/pyproject.toml src/core/pyproject.toml uv.lock src/backend/base/uv.lock
git commit -m "Update version and project name"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Include src/core/uv.lock in commit to avoid lockfile drift

You run uv lock in src/core (Line 92) but don’t stage src/core/uv.lock (Line 94). This can desync the core package versioning in nightly tags.

Apply this diff:

-          git add pyproject.toml src/backend/base/pyproject.toml src/core/pyproject.toml uv.lock src/backend/base/uv.lock
+          git add pyproject.toml src/backend/base/pyproject.toml src/core/pyproject.toml \
+            uv.lock src/backend/base/uv.lock src/core/uv.lock
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uv lock
cd src/backend/base && uv lock && cd ../../..
cd src/lfx && uv lock && cd ../..
cd src/core && uv lock && cd ../..
git add pyproject.toml src/backend/base/pyproject.toml src/lfx/pyproject.toml uv.lock src/backend/base/uv.lock
git add pyproject.toml src/backend/base/pyproject.toml src/core/pyproject.toml uv.lock src/backend/base/uv.lock
git commit -m "Update version and project name"
uv lock
cd src/backend/base && uv lock && cd ../../..
cd src/core && uv lock && cd ../..
git add pyproject.toml src/backend/base/pyproject.toml src/core/pyproject.toml \
uv.lock src/backend/base/uv.lock src/core/uv.lock
git commit -m "Update version and project name"
🤖 Prompt for AI Agents
.github/workflows/nightly_build.yml around lines 90 to 96: the workflow runs `uv
lock` in src/core but does not stage src/core/uv.lock, which can cause lockfile
drift; update the git add command to include src/core/uv.lock (i.e., add that
path to the list of files being staged) so the newly generated core lockfile is
committed alongside the other pyproject and uv.lock files.

echo "Tagging main with $MAIN_TAG"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release-lfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Check version
id: check
run: |
cd src/lfx
cd src/core
# Use uv tree to get package info, consistent with nightly workflow
name=$(uv tree | grep 'lfx' | head -n 1 | awk '{print $1}')
version=$(uv tree | grep 'lfx' | head -n 1 | awk '{print $2}')
Expand Down Expand Up @@ -107,12 +107,12 @@ jobs:

- name: Run LFX tests
run: |
cd src/lfx
cd src/core
make test

- name: Test CLI installation
run: |
cd src/lfx
cd src/core
uv pip install .
uv run lfx --help
uv run lfx run --help
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
- name: Verify Version
id: check-version
run: |
cd src/lfx
cd src/core
# Use uv tree to get package info, consistent with nightly workflow
name=$(uv tree | grep 'lfx' | head -n 1 | awk '{print $1}')
version=$(uv tree | grep 'lfx' | head -n 1 | awk '{print $2}')
Expand All @@ -166,20 +166,20 @@ jobs:

- name: Build distribution
run: |
cd src/lfx
cd src/core
rm -rf dist/
uv build --wheel --out-dir dist

- name: Check build artifacts
run: |
cd src/lfx
cd src/core
ls -la dist/
# Verify wheel contents
unzip -l dist/*.whl | grep -E "(lfx/__main__.py|lfx/cli/run.py|lfx/cli/commands.py)"

- name: Test installation from wheel
run: |
cd src/lfx
cd src/core
uv pip install dist/*.whl --force-reinstall
uv run lfx --help
echo "LFX CLI test completed successfully"
Expand All @@ -188,15 +188,15 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: lfx-dist
path: src/lfx/dist/
path: src/core/dist/
retention-days: 5

- name: Publish to PyPI
if: github.event.inputs.publish_pypi == 'true'
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
cd src/lfx
cd src/core
uv publish dist/*.whl

build-docker:
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: src/lfx/docker/Dockerfile${{ matrix.variant == 'alpine' && '.alpine' || '' }}
file: src/core/docker/Dockerfile${{ matrix.variant == 'alpine' && '.alpine' || '' }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ jobs:
- name: Check Version
id: check-version
run: |
cd src/lfx
cd src/core
version=$(uv tree | grep 'lfx' | head -n 1 | awk '{print $2}' | sed 's/^v//')
last_released_version=$(curl -s "https://pypi.org/pypi/lfx/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
if [ "$version" = "$last_released_version" ]; then
Expand All @@ -364,19 +364,19 @@ jobs:
fi
- name: Build project for distribution
run: |
cd src/lfx
cd src/core
rm -rf dist/
uv build --wheel --out-dir dist
- name: Test CLI
run: |
cd src/lfx
cd src/core
uv pip install dist/*.whl --force-reinstall
uv run lfx --help
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: dist-lfx
path: src/lfx/dist
path: src/core/dist

publish-lfx:
name: Publish LFX to PyPI
Expand All @@ -388,7 +388,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: dist-lfx
path: src/lfx/dist
path: src/core/dist
- name: Setup Environment
uses: astral-sh/setup-uv@v6
with:
Expand All @@ -398,7 +398,7 @@ jobs:
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
cd src/lfx && uv publish dist/*.whl
cd src/core && uv publish dist/*.whl

create_release:
name: Create Release
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
prune-cache: false
- name: Install LFX dependencies
run: cd src/lfx && uv sync
run: cd src/core && uv sync

- name: Verify Nightly Name and Version
id: verify
run: |
cd src/lfx
cd src/core
name=$(uv tree | grep 'lfx' | head -n 1 | awk '{print $1}')
version=$(uv tree | grep 'lfx' | head -n 1 | awk '{print $2}')
if [ "$name" != "lfx-nightly" ]; then
Expand All @@ -121,13 +121,13 @@ jobs:

- name: Build LFX for distribution
run: |
cd src/lfx
cd src/core
rm -rf dist/
uv build --wheel --out-dir dist

- name: Test LFX CLI
run: |
cd src/lfx
cd src/core
uv pip install dist/*.whl --force-reinstall
uv run lfx --help
echo "LFX CLI test completed successfully"
Expand All @@ -138,7 +138,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: dist-nightly-lfx
path: src/lfx/dist
path: src/core/dist

build-nightly-base:
name: Build Langflow Nightly Base
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: dist-nightly-lfx
path: src/lfx/dist
path: src/core/dist
- name: Setup Environment
uses: astral-sh/setup-uv@v6
with:
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ unit_tests_looponfail:

lfx_tests: ## run lfx package unit tests
@echo 'Running LFX Package Tests...'
@cd src/lfx && \
@cd src/core && \
uv sync && \
uv run pytest tests/unit -v $(args)

Expand Down Expand Up @@ -421,43 +421,43 @@ publish_testpypi: ## build the frontend static files and package the project and

lfx_build: ## build the LFX package
@echo 'Building LFX package'
@cd src/lfx && make build
@cd src/core && make build

lfx_publish: ## publish LFX package to PyPI
@echo 'Publishing LFX package'
@cd src/lfx && make publish
@cd src/core && make publish

lfx_publish_testpypi: ## publish LFX package to test PyPI
@echo 'Publishing LFX package to test PyPI'
@cd src/lfx && make publish_test
@cd src/core && make publish_test

lfx_test: ## run LFX tests
@echo 'Running LFX tests'
@cd src/lfx && make test
@cd src/core && make test

lfx_format: ## format LFX code
@echo 'Formatting LFX code'
@cd src/lfx && make format
@cd src/core && make format

lfx_lint: ## lint LFX code
@echo 'Linting LFX code'
@cd src/lfx && make lint
@cd src/core && make lint

lfx_clean: ## clean LFX build artifacts
@echo 'Cleaning LFX build artifacts'
@cd src/lfx && make clean
@cd src/core && make clean

lfx_docker_build: ## build LFX production Docker image
@echo 'Building LFX Docker image'
@cd src/lfx && make docker_build
@cd src/core && make docker_build

lfx_docker_dev: ## start LFX development environment
@echo 'Starting LFX development environment'
@cd src/lfx && make docker_dev
@cd src/core && make docker_dev

lfx_docker_test: ## run LFX tests in Docker
@echo 'Running LFX tests in Docker'
@cd src/lfx && make docker_test
@cd src/core && make docker_test

# example make alembic-revision message="Add user table"
alembic-revision: ## generate a new migration
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ lfx = { workspace = true }
members = [
"src/backend/base",
".",
"src/lfx",
"src/core",
]

[tool.hatch.build.targets.wheel]
Expand Down Expand Up @@ -262,7 +262,7 @@ ignore-regex = '.*(Stati Uniti|Tense=Pres).*'
timeout = 150
timeout_method = "signal"
minversion = "6.0"
testpaths = ["src/backend/tests", "src/lfx/tests"]
testpaths = ["src/backend/tests", "src/core/tests"]
console_output_style = "progress"
filterwarnings = ["ignore::DeprecationWarning", "ignore::ResourceWarning"]
log_cli = true
Expand Down
1 change: 0 additions & 1 deletion scripts/ci/update_starter_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
update_projects_components_with_latest_component_versions,
)
from langflow.services.utils import initialize_services

from lfx.interface.components import get_and_cache_all_types_dict
from lfx.services.deps import get_settings_service

Expand Down
2 changes: 1 addition & 1 deletion src/backend/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from uuid import uuid4

import pytest
from lfx.custom.custom_component.component import Component
from typing_extensions import TypedDict

from lfx.custom.custom_component.component import Component
from tests.constants import SUPPORTED_VERSIONS
from tests.integration.utils import build_component_instance_for_tests

Expand Down
6 changes: 3 additions & 3 deletions src/backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
from langflow.services.database.models.vertex_builds.crud import delete_vertex_builds_by_flow_id
from langflow.services.database.utils import session_getter
from langflow.services.deps import get_db_service, session_scope
from lfx.components.input_output import ChatInput
from lfx.graph import Graph
from lfx.log.logger import logger
from sqlalchemy.ext.asyncio import create_async_engine
from sqlalchemy.orm import selectinload
from sqlmodel import Session, SQLModel, create_engine, select
from sqlmodel.ext.asyncio.session import AsyncSession
from sqlmodel.pool import StaticPool
from typer.testing import CliRunner

from lfx.components.input_output import ChatInput
from lfx.graph import Graph
from lfx.log.logger import logger
from tests.api_keys import get_openai_api_key

load_dotenv()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from lfx.schema.message import Message

from tests.api_keys import get_openai_api_key
from tests.integration.utils import download_flow_from_github, run_json_flow

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import pytest

from lfx.components.datastax import (
AssistantsCreateAssistant,
AssistantsCreateThread,
AssistantsGetAssistantName,
AssistantsListAssistants,
AssistantsRun,
)

from tests.integration.utils import run_single_component


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from astrapy import DataAPIClient
from langchain_astradb import AstraDBVectorStore, VectorServiceOptions
from langchain_core.documents import Document

from lfx.components.openai.openai import OpenAIEmbeddingsComponent
from lfx.components.vectorstores import AstraDBVectorStoreComponent
from lfx.schema.data import Data

from tests.api_keys import get_astradb_api_endpoint, get_astradb_application_token, get_openai_api_key
from tests.integration.components.mock_components import TextToData
from tests.integration.utils import ComponentInputHandle, run_single_component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from lfx.components.input_output import ChatInput
from lfx.components.processing.parse_json_data import ParseJSONDataComponent
from lfx.schema import Data

from tests.integration.components.mock_components import TextToData
from tests.integration.utils import ComponentInputHandle, pyleak_marker, run_single_component

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from lfx.components.input_output import ChatInput
from lfx.memory import aget_messages
from lfx.schema.message import Message

from tests.integration.utils import pyleak_marker, run_single_component

pytestmark = pyleak_marker()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from lfx.components.input_output import TextInputComponent
from lfx.schema.message import Message

from tests.integration.utils import pyleak_marker, run_single_component

pytestmark = pyleak_marker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

import psutil
import pytest
from mcp import StdioServerParameters

from lfx.base.mcp.util import MCPSessionManager
from lfx.log.logger import logger
from mcp import StdioServerParameters

pytestmark = [
pytest.mark.timeout(300, method="thread"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os

import pytest

from lfx.components.helpers import OutputParserComponent
from lfx.components.openai.openai_chat_model import OpenAIModelComponent
from lfx.components.processing import PromptComponent

from tests.integration.utils import ComponentInputHandle, run_single_component


Expand Down
Loading
Loading