Skip to content

Commit

Permalink
Merge branch 'main' into voice_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Nov 15, 2024
2 parents 8bd3f2d + 2881346 commit e2163ae
Show file tree
Hide file tree
Showing 370 changed files with 5,002 additions and 8,120 deletions.
7 changes: 5 additions & 2 deletions .github/changes-filter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ python:
- "pyproject.toml"
- "poetry.lock"
- "**/python_test.yml"
tests:
- "tests/**"
components-changes:
- "src/backend/base/langflow/components/**"
starter-projects-changes:
- "src/backend/base/langflow/initial_setup/**"
frontend-tests:
- "src/frontend/tests/**"
frontend:
- "src/frontend/**"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ jobs:
path-filter:
needs: set-ci-condition
if: ${{ needs.set-ci-condition.outputs.should-run-ci == 'true' }}

name: Filter Paths
runs-on: ubuntu-latest
outputs:
python: ${{ steps.filter.outputs.python }}
frontend: ${{ steps.filter.outputs.frontend }}
docs: ${{ steps.filter.outputs.docs }}
tests: ${{ steps.filter.outputs.tests }}
frontend-tests: ${{ steps.filter.outputs.frontend-tests }}
components-changes: ${{ steps.filter.outputs.components-changes }}
starter-projects-changes: ${{ steps.filter.outputs.starter-projects-changes }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -76,15 +77,15 @@ jobs:
test-backend:
needs: path-filter
name: Run Backend Tests
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
if: ${{ needs.path-filter.outputs.python == 'true'}}
uses: ./.github/workflows/python_test.yml
with:
python-versions: ${{ inputs.python-versions || '["3.10"]' }}

test-frontend:
needs: path-filter
name: Run Frontend Tests
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.frontend == 'true' || needs.path-filter.outputs.tests == 'true' }}
if: ${{ needs.path-filter.outputs.frontend == 'true' || needs.path-filter.outputs.frontend-tests == 'true' || needs.path-filter.outputs.components-changes == 'true' || needs.path-filter.outputs.starter-projects-changes == 'true' }}
uses: ./.github/workflows/typescript_test.yml
with:
tests_folder: ${{ inputs.frontend-tests-folder }}
Expand All @@ -94,10 +95,9 @@ jobs:

lint-backend:
needs: path-filter
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
if: ${{ needs.path-filter.outputs.python == 'true'}}
name: Lint Backend
uses: ./.github/workflows/lint-py.yml
# Run only if there are python files changed

test-docs-build:
needs: path-filter
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
paths:
- "src/backend/base/**"
- "src/backend/tests/performance/**"
- "!src/backend/base/langflow/components/**"
workflow_dispatch:

concurrency:
Expand Down
48 changes: 10 additions & 38 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,23 @@ on:
description: "Version to release"
required: true
type: string
release_type:
description: "Type of release (base or main)"
ref:
description: "Commit to tag the release"
required: true
type: choice
options:
- base
- main
type: string
pre_release:
description: "Pre-release tag"
required: true
type: boolean

env:
POETRY_VERSION: "1.8.2"
jobs:
release:
name: Build Langflow
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check-version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "poetry"
- name: Build project for distribution
run: |
if [ "${{ inputs.release_type }}" == "base" ]; then
make build base=true
else
make build main=true
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: dist${{ inputs.release_type }}
path: ${{ inputs.release_type == 'base' && 'src/backend/base/dist' || 'dist' }}
create_release:
name: Create Release Job
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/download-artifact@v4
with:
name: dist${{ inputs.release_type }}
name: dist-main
path: dist
- name: Create Release Notes
uses: ncipollo/release-action@v1
Expand All @@ -59,6 +31,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
generateReleaseNotes: true
prerelease: true
prerelease: ${{ inputs.pre_release }}
tag: v${{ inputs.version }}
commit: dev
commit: ${{ inputs.ref }}
13 changes: 7 additions & 6 deletions .github/workflows/py_autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: autofix.ci
on:
pull_request:
paths:
- "poetry.lock"
- "pyproject.toml"
- "src/backend/**"
- "**/*.py"
env:
POETRY_VERSION: "1.8.2"

Expand All @@ -14,7 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: install-pinned/ruff@9ebc31a5721a0fb034f915e4bbcb2ee6feeaecbc
- run: ruff check --fix-only .
- run: ruff format .
- name: "Setup Environment"
uses: ./.github/actions/setup-uv
- run: uv run ruff check --fix-only .
- run: uv run ruff format .
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
- name: Minimize uv cache
run: uv cache prune --ci
4 changes: 2 additions & 2 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ jobs:
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/api/v1/auto_login; do sleep 5; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
# Terminate the server
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
sleep 10 # give the server some time to terminate
sleep 20 # give the server some time to terminate
# Check if the server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Failed to terminate the server"
exit 1
exit 0
else
echo "Server terminated successfully"
fi
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Check Version
id: check-version
run: |
version=$(uv tree | grep 'langflow-base' | awk '{print $3}')
version=$(uv tree | grep 'langflow-base' | awk '{print $3}' | sed 's/^v//')
last_released_version=$(curl -s "https://pypi.org/pypi/langflow-base/json" | jq -r '.releases | keys | .[]' | sort -V | tail -n 1)
if [ "$version" = "$last_released_version" ]; then
echo "Version $version is already released. Skipping release."
Expand All @@ -94,15 +94,16 @@ jobs:
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/api/v1/auto_login; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
# Terminate the server
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
sleep 10 # give the server some time to terminate
sleep 20 # give the server some time to terminate
# Check if the server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Failed to terminate the server"
exit 1
exit 0
else
echo "Server terminated successfully"
fi
- name: Publish to PyPI
if: steps.check-version.outputs.skipped == 'false'
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
Expand Down Expand Up @@ -167,11 +168,11 @@ jobs:
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/health_check; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
# Terminate the server
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
sleep 10 # give the server some time to terminate
sleep 20 # give the server some time to terminate
# Check if the server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Failed to terminate the server"
exit 1
exit 0
else
echo "Server terminated successfully"
fi
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ jobs:
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/api/v1/auto_login; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
# Terminate the server
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
sleep 10 # give the server some time to terminate
sleep 20 # give the server some time to terminate
# Check if the server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Failed to terminate the server"
exit 1
exit 0
else
echo "Server terminated successfully"
fi
Expand Down Expand Up @@ -181,11 +181,11 @@ jobs:
timeout 120 bash -c 'until curl -f http://127.0.0.1:7860/health_check; do sleep 2; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
# Terminate the server
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
sleep 10 # give the server some time to terminate
sleep 20 # give the server some time to terminate
# Check if the server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Failed to terminate the server"
exit 1
exit 0
else
echo "Server terminated successfully"
fi
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/style-check-py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Ruff Style Check
on:
pull_request:
types: [opened, synchronize, reopened, auto_merge_enabled]
paths:
- "**/*.py"



Expand Down
1 change: 1 addition & 0 deletions .github/workflows/typescript_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
matrix:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shardTotal: [10]

env:
OPENAI_API_KEY: ${{ inputs.openai_api_key || secrets.OPENAI_API_KEY }}
STORE_API_KEY: ${{ inputs.store_api_key || secrets.STORE_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This will set up the development environment by installing backend and frontend

It is advised to run `make lint`, `make format`, and `make unit_tests` before pushing to the repository.

### Run locally (Poetry and Node.js)
### Run locally (uv and Node.js)

Langflow can run locally by cloning the repository and installing the dependencies. We recommend using a virtual environment to isolate the dependencies from your system.

Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,8 @@ patch: ## bump the version in langflow and langflow-base
check_tools:
@command -v uv >/dev/null 2>&1 || { echo >&2 "$(RED)uv is not installed. Aborting.$(NC)"; exit 1; }
@command -v npm >/dev/null 2>&1 || { echo >&2 "$(RED)NPM is not installed. Aborting.$(NC)"; exit 1; }
@command -v pipx >/dev/null 2>&1 || { echo >&2 "$(RED)pipx is not installed. Aborting.$(NC)"; exit 1; }
@$(MAKE) check_env
@echo "$(GREEN)All required tools are installed.$(NC)"

# check if Python version is compatible
check_env: ## check if Python version is compatible
@chmod +x scripts/setup/check_env.sh
@scripts/setup/check_env.sh "$(PYTHON_REQUIRED)"

help: ## show this help message
@echo '----'
Expand Down
1 change: 1 addition & 0 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
:root {
--ifm-background-color: var(--token-primary-bg-c);
--ifm-color-primary: hsla(330, 81%, 60%, 1);
--ifm-navbar-link-hover-color: initial;
--ifm-navbar-padding-vertical: 0;
--ifm-navbar-item-padding-vertical: 0;
Expand Down
1 change: 1 addition & 0 deletions docs/docs/Agents/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"position":5, "label":"Agents"}
Loading

0 comments on commit e2163ae

Please sign in to comment.