feat: package langflow service implementations#14021
Draft
HzaRashid wants to merge 4 commits into
Draft
Conversation
Introduce a standalone `langflow-services` distribution (`services` import path) so concrete backends sit between `langflow-base` and `lfx`: - Dependency direction: langflow-base → langflow-services → lfx - One subpackage per Langflow-owned ServiceType under services/<name>/ - Host CRUD/Alembic/lifecycle stays in langflow-base; LFX keeps contracts - Public langflow.services.* preserved via one-way shim re-exports - Discover factories via lfx.service-packages entry point after host hooks Packaging follows the lfx-bundles pattern (one wheel + optional extras): - Service-shell extras mark ownership; empty when defaults need no extra deps - Backend extras only where selectable: database-sqlite/postgresql, cache-redis, job-queue-redis, storage-s3, task-celery, variable-kubernetes, tracing-*, deployment-watsonx-orchestrate - [production] prefers prod backends (Postgres/Redis/S3/Celery) and otherwise the default impl (including DB-backed variable; K8s stays opt-in) - [all] aggregates shells + backends; does not nest [production] - langflow-base re-exports compatibility aliases and depends on langflow-services[database-sqlite,memory-base] by default CI / release / docs: - Isolated-wheel gate (make check_services_isolated_wheel) - Boundary tests for layout, extras, and no static langflow imports - Nightly/release/Docker/Makefile wiring for the new workspace package - OWNERSHIP.md documents package invariants and backend naming
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
✅ Migration Validation Passed All migrations follow the Expand-Contract pattern correctly. |
Align langflow-services with the bundle/stepflow naming convention: distribution stays langflow-services, implementation imports use langflow_services.*, and langflow.services.* remains the public shim. Also drop runtime langflow discovery fallbacks from the standalone package and tighten boundary tests to cover dynamic imports.
Move langflow-services onto the public 1.x axis (with langflow/lfx) while keeping langflow-base on 0.x, and replace OWNERSHIP.md with a package README. - Set langflow-services to 1.11.0; pin langflow-base → langflow-services~=1.11.0 - Update make patch so services version/pin track LANGFLOW_VERSION (not base) - Decouple nightly/release scripts: services sourced from root/main tag - Add determine-services-version; rebuild services for base even if already on PyPI - Skip publish-services when already_published; preserve extras in pre-release pins - Point Docker/pyproject/sdist at README.md; document stable vs nightly axes - Extend patch-regex, dependency-pin, and nightly-tag regression tests
Drop unused core deps from langflow-services, move email-validator under the telemetry extra, and make langflow-base depend on langflow-services[all] by default so [complete] only adds host-owned extras.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracts Langflow's service implementations into a standalone
langflow-servicesdistribution using thelangflow_services.*namespace.langflow-basewill now depend onlangflow-serviceswhich depends onlfx.This PR is stacked on #14001, which moves canonical ORM models into LFX.
Changes
langflow-servicesworkspace package and packaging metadata.langflow_services.*.ServiceType,ServiceManager, registries, and canonical ORM models in LFX.langflow.services.*modules into one-way compatibility shims so public imports and monkeypatch targets retain object identity.lfx.service-packagesentry point while preserving lazy initialization for jobs, flow events, and MemoryBase.Package boundaries
lfx: service contracts, lifecycle, registries, settings, and ORM models.langflow-services: concrete implementations and implementation-owned helpers.langflow-base: FastAPI host lifecycle, CRUD, Alembic, API helpers, and compatibility shims.The standalone package is prohibited from statically or dynamically importing
langflow.*.Compatibility
Existing
langflow.services.*imports remain supported through thin re-export modules. Leaf shims alias the implementation modules directly, preserving class identity and existing monkeypatch paths.Database CRUD, model shims, migrations, and application startup remain in
langflow-base.Validation
Added coverage for:
langflow-baselangflow_services.*imports with nolangflowleakageThe isolated-wheel CI gate builds
langflow-sdk,lfx, andlangflow-services, installs them into a clean environment, and recursively imports the standalone package.Reviewer notes
Most of the diff is the mechanical relocation of implementations and replacement of the original modules with compatibility shims. The primary review areas are package ownership, dependency direction, host-injected seams, optional dependency mapping, and release wiring.