diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d8faf3dc3..2bc6f5632 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -296,18 +296,15 @@ jobs: python-version: - "3.12" steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_caching" + - name: Check out the code at a specific ref + uses: actions/checkout@v4 with: - python-version: ${{ matrix.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} - - name: Install Python dependencies - run: | - poetry env use ${{ matrix.python-version }} - poetry install + ref: ${{ inputs.nightly_tag_main || github.ref }} + - name: "Setup Environment" + uses: ./.github/actions/setup-uv + with: + ref: ${{ inputs.nightly_tag_main || github.ref }} - name: Restart HuggingFace Spaces Build run: | - poetry run python ./scripts/factory_restart_space.py --space "Langflow/Langflow" --token ${{ secrets.HUGGINGFACE_API_TOKEN }} + uv run ./scripts/factory_restart_space.py --space "Langflow/Langflow" --token ${{ secrets.HUGGINGFACE_API_TOKEN }} diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8a86151a4..c63c5e74c 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -42,16 +42,10 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ inputs.ref || github.ref }} - - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_caching" + - name: "Setup Environment" + uses: ./.github/actions/setup-uv with: - python-version: ${{ matrix.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} - - name: Install Python dependencies - run: | - poetry env use ${{ matrix.python-version }} - poetry install + ref: ${{ inputs.ref || github.ref }} - name: Run integration tests with api keys timeout-minutes: 20 run: | diff --git a/.github/workflows/typescript_test.yml b/.github/workflows/typescript_test.yml index 811f86f15..a45d4c68d 100644 --- a/.github/workflows/typescript_test.yml +++ b/.github/workflows/typescript_test.yml @@ -26,7 +26,6 @@ on: default: "tests" env: - POETRY_VERSION: "1.8.3" NODE_VERSION: "21" PYTHON_VERSION: "3.12" # Define the directory where Playwright browsers will be installed. @@ -103,18 +102,12 @@ jobs: npx playwright install-deps if: steps.playwright-cache.outputs.cache-hit != 'true' - - name: Set up Python ${{ env.PYTHON_VERSION }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_caching" + - name: "Setup Environment" + uses: ./.github/actions/setup-uv with: - python-version: ${{ env.PYTHON_VERSION }} - poetry-version: ${{ env.POETRY_VERSION }} - cache-key: tests - - - name: Install Python dependencies - run: | - poetry env use ${{ env.PYTHON_VERSION }} - poetry lock --no-update - poetry install + ref: ${{ inputs.ref || github.ref }} + - name: Install the project + run: uv sync --dev - name: create .env run: | @@ -138,6 +131,9 @@ jobs: path: src/frontend/blob-report retention-days: 1 + - name: Minimize uv cache + run: uv cache prune --ci + merge-reports: # We need to repeat the condition at every step # https://github.com/actions/runner/issues/662 diff --git a/Makefile b/Makefile index c28b7123f..6f9667a1d 100644 --- a/Makefile +++ b/Makefile @@ -394,8 +394,8 @@ lock_langflow: lock: ## lock dependencies @echo 'Locking dependencies' - cd src/backend/base && uv lock --no-update - uv lock --no-update + cd src/backend/base && uv lock + uv lock update: ## update dependencies @echo 'Updating dependencies' diff --git a/pyproject.toml b/pyproject.toml index 6dddc6238..a987313c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,25 +1,4 @@ -[tool.poetry] -name = "langflow" -version = "1.0.18" -description = "A Python package with a built-in web application" -authors = ["Langflow "] -maintainers = [ - "Carlos Coelho ", - "Cristhian Zanforlin ", - "Gabriel Almeida ", - "Igor Carvalho ", - "Lucas Eduoli ", - "Otávio Anovazzi ", - "Rodrigo Nader ", - "Italo dos Anjos ", -] -repository = "https://github.com/langflow-ai/langflow" -license = "MIT" -readme = "README.md" -keywords = ["nlp", "langchain", "openai", "gpt", "gui"] -packages = [{ include = "langflow", from = "src/backend" }] -include = ["src/backend/langflow/*", "src/backend/langflow/**/*"] -documentation = "https://docs.langflow.org" + [tool.uv.sources] langflow-base = { workspace = true } @@ -36,6 +15,20 @@ name = "langflow" version = "1.0.18" description = "A Python package with a built-in web application" requires-python = ">=3.10,<3.13" +license = "MIT" +keywords = ["nlp", "langchain", "openai", "gpt", "gui"] +readme = "README.md" +maintainers = [ + { name = "Carlos Coelho", email = "carlos@langflow.org" }, + { name = "Cristhian Zanforlin", email = "cristhian.lousa@gmail.com" }, + { name = "Gabriel Almeida", email = "gabriel@langflow.org" }, + { name = "Igor Carvalho", email = "igorr.ackerman@gmail.com" }, + { name = "Lucas Eduoli", email = "lucaseduoli@gmail.com" }, + { name = "Otávio Anovazzi", email = "otavio2204@gmail.com" }, + { name = "Rodrigo Nader", email = "rodrigo@langflow.org" }, + { name = "Italo dos Anjos", email = "italojohnnydosanjos@gmail.com" }, +] + # Define your main dependencies here dependencies = [ "langflow-base==0.0.96", @@ -116,6 +109,10 @@ dependencies = [ "langchain-elasticsearch>=0.2.0", ] +[project.urls] +Repository = "https://github.com/langflow-ai/langflow" +Documentation = "https://docs.langflow.org" + [project.optional-dependencies] deploy = [ "celery[redis]>=5.3.6", @@ -139,138 +136,6 @@ clickhouse-connect = [ [project.scripts] langflow = "langflow.__main__:main" -[tool.poetry.scripts] -langflow = "langflow.__main__:main" - - -[tool.poetry.dependencies] -python = ">=3.10,<3.13" -langflow-base = { path = "./src/backend/base", develop = true } -beautifulsoup4 = "^4.12.2" -google-search-results = "^2.4.1" -google-api-python-client = "^2.130.0" -huggingface-hub = { version = "^0.23.2", extras = ["inference"] } -llama-cpp-python = { version = "~0.2.0", optional = true } -networkx = "^3.1" -fake-useragent = "^1.5.0" -psycopg2-binary = "^2.9.6" -pyarrow = "^14.0.0" -wikipedia = "^1.4.0" -qdrant-client = "^1.9.0" -weaviate-client = "^4.6.5" -sentence-transformers = { version = "^2.3.1", optional = true } -ctransformers = { version = "^0.2.10", optional = true } -cohere = "^5.5.3" -faiss-cpu = "^1.8.0" -types-cachetools = "^5.3.0.5" -pymongo = "^4.6.0" -supabase = "^2.3.0" -certifi = ">=2023.11.17,<2025.0.0" -psycopg = "3.1.9" # https://github.com/psycopg/psycopg/issues/858 -fastavro = "^1.8.0" -celery = { extras = ["redis"], version = "^5.3.6", optional = true } -redis = "^5.0.1" -flower = { version = "^2.0.0", optional = true } -metaphor-python = "^0.1.11" -pywin32 = { version = "^306", markers = "sys_platform == 'win32'" } -langfuse = "^2.33.0" -metal-sdk = "^2.5.0" -markupsafe = "^2.1.3" -boto3 = "~1.34.162" -numexpr = "^2.8.6" -qianfan = "0.3.5" -pgvector = "^0.2.3" -pyautogen = "^0.2.0" -langchain-google-genai = "1.0.8" -langchain-cohere = "^0.1.5" -elasticsearch = "^8.12.0" -pytube = "^15.0.0" -dspy-ai = "^2.4.0" -assemblyai = "^0.33.0" -litellm = "^1.44.0" -chromadb = "^0.4" -langchain-anthropic = "^0.1.23" -langchain-astradb = "^0.3.5" -langchain-openai = "0.1.22" -zep-python = { version = "^2.0.0rc5", allow-prereleases = true } -langchain-google-vertexai = "1.0.10" -langchain-groq = "0.1.9" -langchain-pinecone = "^0.1.3" -langchain-mistralai = "0.1.12" -couchbase = { extras = ["couchbase"], version = "^4.2.1", optional = true } -youtube-transcript-api = "^0.6.2" -markdown = "^3.7" -langchain-chroma = "^0.1.1" -upstash-vector = "^0.5.0" -gitpython = "^3.1.43" -cassio = { extras = ["cassio"], version = "^0.1.7", optional = true } -unstructured = {extras = ["docx", "md", "pptx"], version = "^0.14.4"} -langchain-aws = "^0.1.16" -langchain-mongodb = "^0.1.6" -kubernetes = "^30.1.0" -firecrawl-py = "^0.0.16" -json-repair = "^0.25.2" -langchain-nvidia-ai-endpoints = "0.1.6" -langchain-google-calendar-tools = "^0.0.1" -langchain-milvus = "^0.1.1" -crewai = {extras = ["tools"], version = "^0.36.0"} -langwatch = "^0.1.16" -langsmith = "^0.1.86" -yfinance = "^0.2.40" -langchain-google-community = "1.0.7" -wolframalpha = "^5.1.3" -astra-assistants = "^2.1.2" -composio-langchain = "0.5.9" -spider-client = "^0.0.27" -nltk = "^3.9.1" -lark = "^1.2.2" -jq = "^1.8.0" -clickhouse-connect = {version = "0.7.19", optional = true, extras = ["clickhouse-connect"]} -langchain-unstructured = "^0.1.2" -pydantic-settings = "2.4.0" -ragstack-ai-knowledge-store = "^0.2.1" -duckduckgo-search = "^6.2.12" -langchain-elasticsearch = "^0.2.0" -opensearch-py = "^2.7.1" - - -[tool.poetry.group.dev.dependencies] -types-redis = "^4.6.0.5" -ipykernel = "^6.29.0" -mypy = "^1.11.0" -ruff = ">=0.6.2,<0.7.0" -httpx = "*" -pytest = "^8.2.0" -types-requests = "^2.32.0" -requests = "^2.32.0" -pytest-cov = "^5.0.0" -pandas-stubs = "^2.1.4.231227" -types-pillow = "^10.2.0.20240213" -types-pyyaml = "^6.0.12.8" -types-python-jose = "^3.3.4.8" -types-passlib = "^1.7.7.13" -pytest-mock = "^3.14.0" -pytest-xdist = "^3.6.0" -types-pywin32 = "^306.0.0.4" -types-google-cloud-ndb = "^2.2.0.0" -pytest-sugar = "^1.0.0" -respx = "^0.21.1" -pytest-instafail = "^0.5.0" -pytest-asyncio = "^0.23.0" -pytest-profiling = "^1.7.0" -pre-commit = "^3.7.0" -vulture = "^2.11" -dictdiffer = "^0.9.0" -pytest-split = "^0.9.0" -pytest-flakefinder = "^1.1.0" -types-markdown = "^3.7.0.20240822" -packaging = ">=23.2,<24.0" - -[tool.poetry.extras] -deploy = ["celery", "redis", "flower"] -couchbase = ["couchbase"] -cassio = ["cassio"] -local = ["llama-cpp-python", "sentence-transformers", "ctransformers"] [tool.uv] dev-dependencies = [ @@ -308,13 +173,6 @@ dev-dependencies = [ ] -[tool.poetry.group.spelling] -optional = true - -[tool.poetry.group.spelling.dependencies] -codespell = "^2.3.0" - - [tool.codespell] skip = '.git,*.pdf,*.svg,*.pdf,*.yaml,*.ipynb,poetry.lock,*.min.js,*.css,package-lock.json,*.trig.,**/node_modules/**,./stuff/*,*.csv' # Ignore latin etc diff --git a/scripts/factory_restart_space.py b/scripts/factory_restart_space.py index 07a25d0de..50cf86163 100644 --- a/scripts/factory_restart_space.py +++ b/scripts/factory_restart_space.py @@ -1,3 +1,10 @@ +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "huggingface-hub", +# "rich", +# ] +# /// import argparse from huggingface_hub import HfApi, list_models diff --git a/src/backend/base/pyproject.toml b/src/backend/base/pyproject.toml index 13e7db2ef..0259ac78f 100644 --- a/src/backend/base/pyproject.toml +++ b/src/backend/base/pyproject.toml @@ -1,129 +1,7 @@ -[tool.poetry] -name = "langflow-base" -version = "0.0.96" -description = "A Python package with a built-in web application" -authors = ["Langflow "] -maintainers = [ - "Carlos Coelho ", - "Cristhian Zanforlin ", - "Gabriel Almeida ", - "Igor Carvalho ", - "Lucas Eduoli ", - "Otávio Anovazzi ", - "Rodrigo Nader ", - "Italo dos Anjos ", -] -repository = "https://github.com/langflow-ai/langflow" -license = "MIT" -readme = "README.md" -keywords = ["nlp", "langchain", "openai", "gpt", "gui"] -packages = [{ include = "langflow" }, { include = "langflow/py.typed" }] -include = ["pyproject.toml", "README.md", "langflow/**/*"] -documentation = "https://docs.langflow.org" - - -[tool.poetry.scripts] -langflow-base = "langflow.__main__:main" [tool.hatch.build.targets.wheel] packages = ["langflow"] -[tool.poetry.dependencies] -python = ">=3.10,<3.13" -fastapi = "^0.111.0" -httpx = "*" -uvicorn = "^0.30.0" -gunicorn = "^22.0.0" -langchain = "~0.2.0" -langchain-core = "^0.2.32" -langchainhub = "~0.1.15" -sqlmodel = "^0.0.18" -loguru = "^0.7.1" -rich = "^13.7.0" -langchain-experimental = "^0.0.61" -pydantic = "^2.7.0" -pydantic-settings = "^2.2.0" -websockets = "*" -typer = "^0.12.0" -cachetools = "^5.3.1" -platformdirs = "^4.2.0" -python-multipart = "^0.0.7" -orjson = "3.10.0" -alembic = "^1.13.0" -passlib = "^1.7.4" -bcrypt = "4.0.1" -pillow = "^10.2.0" -docstring-parser = "^0.16" -python-jose = "^3.3.0" -pandas = "2.2.2" -multiprocess = "^0.70.14" -python-docx = "^1.1.0" -jq = { version = "^1.7.0", markers = "sys_platform != 'win32'" } -pypdf = "^4.2.0" -nest-asyncio = "^1.6.0" -emoji = "^2.12.0" -cryptography = ">=42.0.5,<44.0.0" -asyncer = "^0.0.5" -pyperclip = "^1.8.2" -uncurl = "^0.0.11" -sentry-sdk = {extras = ["fastapi", "loguru"], version = "^2.5.1"} -chardet = "^5.2.0" -firecrawl-py = "^0.0.16" -opentelemetry-api = "^1.25.0" -opentelemetry-sdk = "^1.25.0" -opentelemetry-exporter-prometheus = "^0.46b0" -opentelemetry-instrumentation-fastapi = "^0.46b0" -prometheus-client = "^0.20.0" -aiofiles = "^24.1.0" -setuptools = ">=70" -nanoid = "^2.0.0" -filelock = "^3.15.4" -grandalf = "^0.8.0" -crewai = "^0.36.0" -spider-client = "^0.0.27" -diskcache = "^5.6.3" -clickhouse-connect = "0.7.19" - - -[tool.poetry.extras] -deploy = ["celery", "redis", "flower"] -local = ["llama-cpp-python", "sentence-transformers", "ctransformers"] -all = ["deploy", "local"] - - - -[tool.poetry.group.dev.dependencies] -types-redis = "^4.6.0.5" -ipykernel = "^6.29.0" -mypy = "^1.11.0" -ruff = "^0.4.5" -httpx = "*" -pytest = "^8.2.0" -types-requests = "^2.32.0" -requests = "^2.32.0" -pytest-cov = "^5.0.0" -pandas-stubs = "^2.1.4.231227" -types-pillow = "^10.2.0.20240213" -types-pyyaml = "^6.0.12.8" -types-python-jose = "^3.3.4.8" -types-passlib = "^1.7.7.13" -pytest-mock = "^3.14.0" -pytest-xdist = "^3.6.0" -types-pywin32 = "^306.0.0.4" -types-google-cloud-ndb = "^2.2.0.0" -pytest-sugar = "^1.0.0" -respx = "^0.21.1" -pytest-instafail = "^0.5.0" -pytest-asyncio = "^0.23.0" -pytest-profiling = "^1.7.0" -pre-commit = "^3.7.0" -vulture = "^2.11" -dictdiffer = "^0.9.0" -pytest-split = "^0.9.0" -devtools = "^0.12.2" -pytest-flakefinder = "^1.1.0" -types-markdown = "^3.7.0.20240822" -assemblyai = "^0.33.0" [tool.pytest.ini_options] minversion = "6.0" @@ -221,7 +99,6 @@ dev-dependencies = [ requires = ["hatchling"] build-backend = "hatchling.build" - [project] name = "langflow-base" version = "0.0.96" @@ -230,6 +107,18 @@ requires-python = ">=3.10,<3.13" license = "MIT" keywords = ["nlp", "langchain", "openai", "gpt", "gui"] readme = "README.md" +maintainers = [ + { name = "Carlos Coelho", email = "carlos@langflow.org" }, + { name = "Cristhian Zanforlin", email = "cristhian.lousa@gmail.com" }, + { name = "Gabriel Almeida", email = "gabriel@langflow.org" }, + { name = "Igor Carvalho", email = "igorr.ackerman@gmail.com" }, + { name = "Lucas Eduoli", email = "lucaseduoli@gmail.com" }, + { name = "Otávio Anovazzi", email = "otavio2204@gmail.com" }, + { name = "Rodrigo Nader", email = "rodrigo@langflow.org" }, + { name = "Italo dos Anjos", email = "italojohnnydosanjos@gmail.com" }, +] + + dependencies = [ "fastapi>=0.111.0", @@ -288,6 +177,10 @@ dependencies = [ "assemblyai>=0.33.0" ] +[project.urls] +Repository = "https://github.com/langflow-ai/langflow" +Documentation = "https://docs.langflow.org" + # Optional dependencies for uv [project.optional-dependencies] deploy = [ diff --git a/src/frontend/playwright.config.ts b/src/frontend/playwright.config.ts index d4c6a4d24..79be0a2e6 100644 --- a/src/frontend/playwright.config.ts +++ b/src/frontend/playwright.config.ts @@ -103,7 +103,7 @@ export default defineConfig({ webServer: [ { command: - "poetry run uvicorn --factory langflow.main:create_app --host 127.0.0.1 --port 7860 --loop asyncio", + "uv run uvicorn --factory langflow.main:create_app --host 127.0.0.1 --port 7860 --loop asyncio", port: 7860, env: { LANGFLOW_DATABASE_URL: "sqlite:///./temp",