Merge pull request #2370 from pipecat-ai/mb/update-workflows-for-uv

Update workflows for uv
This commit is contained in:
Mark Backman
2025-08-06 05:54:55 -07:00
committed by GitHub
10 changed files with 75 additions and 134 deletions

View File

@@ -21,24 +21,20 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python
id: setup_python - name: Install uv
uses: actions/setup-python@v4 uses: astral-sh/setup-uv@v3
with: with:
python-version: '3.10' version: "latest"
- name: Setup virtual environment
run: | - name: Set up Python
python -m venv .venv run: uv python install 3.10
- name: Install basic Python dependencies
run: | - name: Install development dependencies
source .venv/bin/activate run: uv sync --group dev
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Build project - name: Build project
run: | run: uv build
source .venv/bin/activate
python -m build - name: Install project in editable mode
- name: Install project and other Python dependencies run: uv pip install --editable .
run: |
source .venv/bin/activate
pip install --editable .

View File

@@ -18,35 +18,28 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python - name: Set up Python
id: setup_python run: uv python install 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache virtual environment
uses: actions/cache@v3
with:
# We are hashing dev-requirements.txt and test-requirements.txt which
# contain all dependencies needed to run the tests.
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('dev-requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}
path: .venv
- name: Install system packages - name: Install system packages
id: install_system_packages
run: | run: |
sudo apt-get install -y portaudio19-dev sudo apt-get install -y portaudio19-dev
- name: Setup virtual environment
- name: Install dependencies
run: | run: |
python -m venv .venv uv sync --group dev --extra anthropic --extra aws --extra google --extra langchain
- name: Install basic Python dependencies
run: |
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r dev-requirements.txt -r test-requirements.txt
- name: Run tests with coverage - name: Run tests with coverage
run: | run: |
source .venv/bin/activate uv run coverage run
coverage run uv run coverage xml
coverage xml
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v5
with: with:

View File

@@ -22,25 +22,22 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4 - name: Install uv
uses: astral-sh/setup-uv@v3
with: with:
python-version: "3.10" version: "latest"
- name: Setup virtual environment
run: | - name: Set up Python
python -m venv .venv run: uv python install 3.10
- name: Install development Python dependencies
run: | - name: Install development dependencies
source .venv/bin/activate run: uv sync --group dev
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Ruff formatter - name: Ruff formatter
id: ruff-format id: ruff-format
run: | run: uv run ruff format --diff
source .venv/bin/activate
ruff format --diff
- name: Ruff linter (all rules) - name: Ruff linter (all rules)
id: ruff-check id: ruff-check
run: | run: uv run ruff check
source .venv/bin/activate
ruff check

View File

@@ -17,23 +17,17 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ github.event.inputs.gitref }} ref: ${{ github.event.inputs.gitref }}
- name: Set up Python
id: setup_python - name: Install uv
uses: actions/setup-python@v4 uses: astral-sh/setup-uv@v3
with: with:
python-version: '3.10' version: "latest"
- name: Setup virtual environment - name: Set up Python
run: | run: uv python install 3.10
python -m venv .venv - name: Install development dependencies
- name: Install basic Python dependencies run: uv sync --group dev
run: |
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Build project - name: Build project
run: | run: uv build
source .venv/bin/activate
python -m build
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:

View File

@@ -12,23 +12,16 @@ jobs:
with: with:
fetch-tags: true fetch-tags: true
fetch-depth: 100 fetch-depth: 100
- name: Set up Python - name: Install uv
id: setup_python uses: astral-sh/setup-uv@v3
uses: actions/setup-python@v4
with: with:
python-version: '3.10' version: "latest"
- name: Setup virtual environment - name: Set up Python
run: | run: uv python install 3.10
python -m venv .venv - name: Install development dependencies
- name: Install basic Python dependencies run: uv sync --group dev
run: |
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Build project - name: Build project
run: | run: uv build
source .venv/bin/activate
python -m build
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@@ -38,7 +31,7 @@ jobs:
publish-to-test-pypi: publish-to-test-pypi:
name: "Publish to Test PyPI" name: "Publish to Test PyPI"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ build ] needs: [build]
environment: environment:
name: testpypi name: testpypi
url: https://pypi.org/p/pipecat-ai url: https://pypi.org/p/pipecat-ai

View File

@@ -22,31 +22,23 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python - name: Set up Python
id: setup_python run: uv python install 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache virtual environment
uses: actions/cache@v3
with:
# We are hashing dev-requirements.txt and test-requirements.txt which
# contain all dependencies needed to run the tests.
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('dev-requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}
path: .venv
- name: Install system packages - name: Install system packages
id: install_system_packages
run: | run: |
sudo apt-get install -y portaudio19-dev sudo apt-get install -y portaudio19-dev
- name: Setup virtual environment
- name: Install dependencies
run: | run: |
python -m venv .venv uv sync --group dev --extra anthropic --extra aws --extra google --extra langchain
- name: Install basic Python dependencies
run: |
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r dev-requirements.txt -r test-requirements.txt
- name: Test with pytest - name: Test with pytest
run: | run: |
source .venv/bin/activate uv run pytest
pytest

View File

@@ -1,13 +0,0 @@
build~=1.2.2
coverage~=7.9.1
grpcio-tools~=1.67.1
pip-tools~=7.4.1
pre-commit~=4.2.0
pyright~=1.1.402
pytest~=8.4.1
pytest-asyncio~=1.0.0
pytest-aiohttp==1.1.0
ruff~=0.12.1
setuptools~=78.1.1
setuptools_scm~=8.3.1
python-dotenv~=1.1.1

View File

@@ -18,11 +18,6 @@ The example:
- Individual recording of user audio - Individual recording of user audio
- Individual recording of assistant audio - Individual recording of assistant audio
Example usage (run from pipecat root directory):
$ pip install "pipecat-ai[daily,openai,cartesia,silero]"
$ pip install -r dev-requirements.txt
$ python examples/foundational/34-audio-recording.py
Requirements: Requirements:
- OpenAI API key (for GPT-4) - OpenAI API key (for GPT-4)
- Cartesia API key (for text-to-speech) - Cartesia API key (for text-to-speech)

View File

@@ -23,11 +23,6 @@ The PatternPairAggregator:
- Processes patterns that may span across multiple text chunks - Processes patterns that may span across multiple text chunks
- Returns processed text at sentence boundaries - Returns processed text at sentence boundaries
Example usage (run from pipecat root directory):
$ pip install "pipecat-ai[daily,openai,cartesia,silero]"
$ pip install -r dev-requirements.txt
$ python examples/foundational/35-pattern-pair-voice-switching.py
Requirements: Requirements:
- OpenAI API key (for GPT-4o) - OpenAI API key (for GPT-4o)
- Cartesia API key (for text-to-speech) - Cartesia API key (for text-to-speech)

View File

@@ -1 +0,0 @@
-e ".[anthropic,aws,google,langchain]"