diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0759bcb69..c9694e5ce 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,24 +21,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python - id: setup_python - uses: actions/setup-python@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 with: - python-version: '3.10' - - name: Setup virtual environment - run: | - python -m venv .venv - - name: Install basic Python dependencies - run: | - source .venv/bin/activate - python -m pip install --upgrade pip - pip install -r dev-requirements.txt + version: "latest" + + - name: Set up Python + run: uv python install 3.10 + + - name: Install development dependencies + run: uv sync --group dev + - name: Build project - run: | - source .venv/bin/activate - python -m build - - name: Install project and other Python dependencies - run: | - source .venv/bin/activate - pip install --editable . + run: uv build + + - name: Install project in editable mode + run: uv pip install --editable . \ No newline at end of file diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 9a7441058..9cdb94c45 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -18,35 +18,28 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + version: "latest" + - name: Set up Python - id: setup_python - 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 + run: uv python install 3.10 + - name: Install system packages - id: install_system_packages run: | sudo apt-get install -y portaudio19-dev - - name: Setup virtual environment + + - name: Install dependencies run: | - python -m venv .venv - - 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 + uv sync --group dev --extra anthropic --extra aws --extra google --extra langchain + - name: Run tests with coverage run: | - source .venv/bin/activate - coverage run - coverage xml + uv run coverage run + uv run coverage xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 7d1219411..2132ce021 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -22,25 +22,22 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 with: - python-version: "3.10" - - name: Setup virtual environment - run: | - python -m venv .venv - - name: Install development Python dependencies - run: | - source .venv/bin/activate - python -m pip install --upgrade pip - pip install -r dev-requirements.txt + version: "latest" + + - name: Set up Python + run: uv python install 3.10 + + - name: Install development dependencies + run: uv sync --group dev + - name: Ruff formatter id: ruff-format - run: | - source .venv/bin/activate - ruff format --diff + run: uv run ruff format --diff + - name: Ruff linter (all rules) id: ruff-check - run: | - source .venv/bin/activate - ruff check + run: uv run ruff check \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 595bab82d..b332de18f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -17,23 +17,17 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.gitref }} - - name: Set up Python - id: setup_python - uses: actions/setup-python@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 with: - python-version: '3.10' - - name: Setup virtual environment - run: | - python -m venv .venv - - name: Install basic Python dependencies - run: | - source .venv/bin/activate - python -m pip install --upgrade pip - pip install -r dev-requirements.txt + version: "latest" + - name: Set up Python + run: uv python install 3.10 + - name: Install development dependencies + run: uv sync --group dev - name: Build project - run: | - source .venv/bin/activate - python -m build + run: uv build - name: Upload wheels uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/publish_test.yaml b/.github/workflows/publish_test.yaml index 4902c9759..4aae38f37 100644 --- a/.github/workflows/publish_test.yaml +++ b/.github/workflows/publish_test.yaml @@ -12,23 +12,16 @@ jobs: with: fetch-tags: true fetch-depth: 100 - - name: Set up Python - id: setup_python - uses: actions/setup-python@v4 + - name: Install uv + uses: astral-sh/setup-uv@v3 with: - python-version: '3.10' - - name: Setup virtual environment - run: | - python -m venv .venv - - name: Install basic Python dependencies - run: | - source .venv/bin/activate - python -m pip install --upgrade pip - pip install -r dev-requirements.txt + version: "latest" + - name: Set up Python + run: uv python install 3.10 + - name: Install development dependencies + run: uv sync --group dev - name: Build project - run: | - source .venv/bin/activate - python -m build + run: uv build - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -38,7 +31,7 @@ jobs: publish-to-test-pypi: name: "Publish to Test PyPI" runs-on: ubuntu-latest - needs: [ build ] + needs: [build] environment: name: testpypi url: https://pypi.org/p/pipecat-ai diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bd6961dd5..a273aee4e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -22,31 +22,23 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + version: "latest" + - name: Set up Python - id: setup_python - 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 + run: uv python install 3.10 + - name: Install system packages - id: install_system_packages run: | sudo apt-get install -y portaudio19-dev - - name: Setup virtual environment + + - name: Install dependencies run: | - python -m venv .venv - - 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 + uv sync --group dev --extra anthropic --extra aws --extra google --extra langchain + - name: Test with pytest run: | - source .venv/bin/activate - pytest + uv run pytest diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index fec8adf52..000000000 --- a/test-requirements.txt +++ /dev/null @@ -1 +0,0 @@ --e ".[anthropic,aws,google,langchain]"