Skip to content

Commit 639db6a

Browse files
committed
Resolve merge conflict: adapt Mistral embedding to new modular structure
- Remove old embedding_configurator.py (deleted in upstream) - Add new Mistral provider following new modular pattern - Create MistralProvider class with proper configuration - Update factory.py to include Mistral support - Maintain backward compatibility with existing MistralEmbeddingFunction
2 parents 4ff4ff2 + b5b10a8 commit 639db6a

File tree

1,030 files changed

+85315
-11805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,030 files changed

+85315
-11805
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build uv cache
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "uv.lock"
9+
- "pyproject.toml"
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build-cache:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.10", "3.11", "3.12", "3.13"]
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
version: "0.8.4"
30+
python-version: ${{ matrix.python-version }}
31+
enable-cache: false
32+
33+
- name: Install dependencies and populate cache
34+
run: |
35+
echo "Building global UV cache for Python ${{ matrix.python-version }}..."
36+
uv sync --all-groups --all-extras --no-install-project
37+
echo "Cache populated successfully"
38+
39+
- name: Save uv caches
40+
uses: actions/cache/save@v4
41+
with:
42+
path: |
43+
~/.cache/uv
44+
~/.local/share/uv
45+
.venv
46+
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}

.github/workflows/codeql.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
paths-ignore:
18+
- "src/crewai/cli/templates/**"
19+
pull_request:
20+
branches: [ "main" ]
21+
paths-ignore:
22+
- "src/crewai/cli/templates/**"
23+
24+
jobs:
25+
analyze:
26+
name: Analyze (${{ matrix.language }})
27+
# Runner size impacts CodeQL analysis time. To learn more, please see:
28+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
29+
# - https://gh.io/supported-runners-and-hardware-resources
30+
# - https://gh.io/using-larger-runners (GitHub.com only)
31+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
32+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
33+
permissions:
34+
# required for all workflows
35+
security-events: write
36+
37+
# required to fetch internal or private CodeQL packs
38+
packages: read
39+
40+
# only required for workflows in private repositories
41+
actions: read
42+
contents: read
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- language: actions
49+
build-mode: none
50+
- language: python
51+
build-mode: none
52+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
53+
# Use `c-cpp` to analyze code written in C, C++ or both
54+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
55+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
56+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
57+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
58+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
59+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
64+
# Add any setup steps before running the `github/codeql-action/init` action.
65+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
66+
# or others). This is typically only required for manual builds.
67+
# - name: Setup runtime (example)
68+
# uses: actions/setup-example@v1
69+
70+
# Initializes the CodeQL tools for scanning.
71+
- name: Initialize CodeQL
72+
uses: github/codeql-action/init@v3
73+
with:
74+
languages: ${{ matrix.language }}
75+
build-mode: ${{ matrix.build-mode }}
76+
# If you wish to specify custom queries, you can do so here or in a config file.
77+
# By default, queries listed here will override any specified in a config file.
78+
# Prefix the list here with "+" to use these queries and those in the config file.
79+
80+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
81+
# queries: security-extended,security-and-quality
82+
83+
# If the analyze step fails for one of the languages you are analyzing with
84+
# "We were unable to automatically build your code", modify the matrix above
85+
# to set the build mode to "manual" for that language. Then modify this step
86+
# to build your code.
87+
# ℹ️ Command-line programs to run using the OS shell.
88+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
89+
- if: matrix.build-mode == 'manual'
90+
shell: bash
91+
run: |
92+
echo 'If you are using a "manual" build mode for one or more of the' \
93+
'languages you are analyzing, replace this with the commands to build' \
94+
'your code, for example:'
95+
echo ' make bootstrap'
96+
echo ' make release'
97+
exit 1
98+
99+
- name: Perform CodeQL Analysis
100+
uses: github/codeql-action/analyze@v3
101+
with:
102+
category: "/language:${{matrix.language}}"

.github/workflows/linter.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Lint
22

33
on: [pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
lint:
710
runs-on: ubuntu-latest
@@ -15,8 +18,27 @@ jobs:
1518
- name: Fetch Target Branch
1619
run: git fetch origin $TARGET_BRANCH --depth=1
1720

18-
- name: Install Ruff
19-
run: pip install ruff
21+
- name: Restore global uv cache
22+
id: cache-restore
23+
uses: actions/cache/restore@v4
24+
with:
25+
path: |
26+
~/.cache/uv
27+
~/.local/share/uv
28+
.venv
29+
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
30+
restore-keys: |
31+
uv-main-py3.11-
32+
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v6
35+
with:
36+
version: "0.8.4"
37+
python-version: "3.11"
38+
enable-cache: false
39+
40+
- name: Install dependencies
41+
run: uv sync --all-groups --all-extras --no-install-project
2042

2143
- name: Get Changed Python Files
2244
id: changed-files
@@ -33,4 +55,14 @@ jobs:
3355
echo "${{ steps.changed-files.outputs.files }}" \
3456
| tr ' ' '\n' \
3557
| grep -v 'src/crewai/cli/templates/' \
36-
| xargs -I{} ruff check "{}"
58+
| xargs -I{} uv run ruff check "{}"
59+
60+
- name: Save uv caches
61+
if: steps.cache-restore.outputs.cache-hit != 'true'
62+
uses: actions/cache/save@v4
63+
with:
64+
path: |
65+
~/.cache/uv
66+
~/.local/share/uv
67+
.venv
68+
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}

.github/workflows/security-checker.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Run Tests
33
on: [pull_request]
44

55
permissions:
6-
contents: write
6+
contents: read
77

88
env:
99
OPENAI_API_KEY: fake-api-key
@@ -22,29 +22,76 @@ jobs:
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # Fetch all history for proper diff
2527

26-
- name: Install uv
27-
uses: astral-sh/setup-uv@v3
28+
- name: Restore global uv cache
29+
id: cache-restore
30+
uses: actions/cache/restore@v4
2831
with:
29-
enable-cache: true
30-
cache-dependency-glob: |
31-
**/pyproject.toml
32-
**/uv.lock
32+
path: |
33+
~/.cache/uv
34+
~/.local/share/uv
35+
.venv
36+
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
37+
restore-keys: |
38+
uv-main-py${{ matrix.python-version }}-
3339
34-
- name: Set up Python ${{ matrix.python-version }}
35-
run: uv python install ${{ matrix.python-version }}
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v6
42+
with:
43+
version: "0.8.4"
44+
python-version: ${{ matrix.python-version }}
45+
enable-cache: false
3646

3747
- name: Install the project
38-
run: uv sync --dev --all-extras
48+
run: uv sync --all-groups --all-extras
49+
50+
- name: Restore test durations
51+
uses: actions/cache/restore@v4
52+
with:
53+
path: .test_durations_py*
54+
key: test-durations-py${{ matrix.python-version }}
3955

4056
- name: Run tests (group ${{ matrix.group }} of 8)
4157
run: |
58+
PYTHON_VERSION_SAFE=$(echo "${{ matrix.python-version }}" | tr '.' '_')
59+
DURATION_FILE=".test_durations_py${PYTHON_VERSION_SAFE}"
60+
61+
# Temporarily always skip cached durations to fix test splitting
62+
# When durations don't match, pytest-split runs duplicate tests instead of splitting
63+
echo "Using even test splitting (duration cache disabled until fix merged)"
64+
DURATIONS_ARG=""
65+
66+
# Original logic (disabled temporarily):
67+
# if [ ! -f "$DURATION_FILE" ]; then
68+
# echo "No cached durations found, tests will be split evenly"
69+
# DURATIONS_ARG=""
70+
# elif git diff origin/${{ github.base_ref }}...HEAD --name-only 2>/dev/null | grep -q "^tests/.*\.py$"; then
71+
# echo "Test files have changed, skipping cached durations to avoid mismatches"
72+
# DURATIONS_ARG=""
73+
# else
74+
# echo "No test changes detected, using cached test durations for optimal splitting"
75+
# DURATIONS_ARG="--durations-path=${DURATION_FILE}"
76+
# fi
77+
4278
uv run pytest \
4379
--block-network \
4480
--timeout=30 \
4581
-vv \
4682
--splits 8 \
4783
--group ${{ matrix.group }} \
84+
$DURATIONS_ARG \
4885
--durations=10 \
4986
-n auto \
5087
--maxfail=3
88+
89+
- name: Save uv caches
90+
if: steps.cache-restore.outputs.cache-hit != 'true'
91+
uses: actions/cache/save@v4
92+
with:
93+
path: |
94+
~/.cache/uv
95+
~/.local/share/uv
96+
.venv
97+
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}

0 commit comments

Comments
 (0)