Skip to content

Commit

Permalink
Use UV instead of pip to install dependencies in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Jan 8, 2025
1 parent 62bf061 commit 766ccbd
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 114 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,23 @@ jobs:
python-version: "3.9"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -e .[test,cosmosdb,interop]
uv pip install --system -e .[test,cosmosdb,interop]
python -c "import autogen"
pip install pytest-cov>=5 mock
uv pip install --system pytest-cov>=5 mock
- name: Install optional dependencies for code executors
# code executors and udfs auto skip without deps, so only run for python 3.11
if: matrix.python-version == '3.11'
run: |
pip install -e ".[jupyter-executor]"
uv pip install --system -e ".[jupyter-executor]"
python -m ipykernel install --user --name python3
- name: Set AUTOGEN_USE_DOCKER based on OS
shell: bash
Expand All @@ -88,7 +90,7 @@ jobs:
if: matrix.python-version != '3.10' && matrix.os == 'ubuntu-latest'
# Remove the line below once https://github.com/docker/docker-py/issues/3256 is merged
run: |
pip install "requests<2.32.0"
uv pip install --system "requests<2.32.0"
pytest test --ignore=test/agentchat/contrib --skip-openai --durations=10 --durations-min=1.0
- name: Test with pytest skipping openai and docker tests
if: matrix.python-version != '3.10' && matrix.os != 'ubuntu-latest'
Expand All @@ -97,7 +99,7 @@ jobs:
- name: Coverage with Redis
if: matrix.python-version == '3.10'
run: |
pip install -e .[redis,websockets]
uv pip install --system -e .[redis,websockets]
pytest test --ignore=test/agentchat/contrib --skip-openai --durations=10 --durations-min=1.0
- name: Test with Cosmos DB
run: |
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/contrib-graph-rag-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ jobs:
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
run: |
python -m pip install --upgrade pip wheel
pip install pytest
uv pip install --system pytest
- name: Install FalkorDB SDK when on linux
run: |
pip install -e .[graph-rag-falkor-db]
uv pip install --system -e .[graph-rag-falkor-db]
- name: Set AUTOGEN_USE_DOCKER based on OS
shell: bash
run: |
Expand All @@ -57,7 +59,7 @@ jobs:
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
run: |
pip install pytest-cov>=5
uv pip install --system pytest-cov>=5
pytest test/agentchat/contrib/graph_rag/test_falkor_graph_rag.py --skip-openai
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand All @@ -81,17 +83,19 @@ jobs:
NEO4J_AUTH: neo4j/password
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
run: |
python -m pip install --upgrade pip wheel
pip install pytest
uv pip install --system pytest
- name: Install Neo4j and Llama-index when on linux
run: |
pip install -e .[neo4j_graph_rag]
uv pip install --system -e .[neo4j_graph_rag]
- name: Set AUTOGEN_USE_DOCKER based on OS
shell: bash
run: |
Expand All @@ -103,7 +107,7 @@ jobs:
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
run: |
pip install pytest-cov>=5
uv pip install --system pytest-cov>=5
pytest test/agentchat/contrib/graph_rag/test_neo4j_graph_rag.py --skip-openai
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/contrib-openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,17 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
run: |
docker --version
python -m pip install --upgrade pip wheel
pip install -e .[teachable,test]
uv pip install --system -e .[teachable,test]
python -c "import autogen"
- name: Coverage
env:
Expand Down Expand Up @@ -202,20 +204,22 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
run: |
docker --version
python -m pip install --upgrade pip wheel
pip install -e ".[test]"
uv pip install --system -e ".[test]"
python -c "import autogen"
pip install pytest-cov>=5 pytest-asyncio
uv pip install --system pytest-cov>=5 pytest-asyncio
- name: Install packages for test when needed
run: |
pip install -e .[autobuild]
uv pip install --system -e .[autobuild]
- name: Coverage
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand Down Expand Up @@ -281,15 +285,17 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
run: |
docker --version
python -m pip install --upgrade pip wheel
pip install -e .[lmm,test]
uv pip install --system -e .[lmm,test]
python -c "import autogen"
- name: Coverage
env:
Expand Down
Loading

0 comments on commit 766ccbd

Please sign in to comment.