Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CI_Pipeline): resolve dependency issues causing build failures #1508

Merged
merged 9 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: ci-core

on:
push:
branches: [main]
pull_request:

jobs:
core-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.10", "3.11"]

steps:
- name: Clean up instance space
if: matrix.os != 'windows-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h

- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry (Unix)
if: matrix.os != 'windows-latest'
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV

- name: Install Poetry (Windows)
if: matrix.os == 'windows-latest'
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
echo "C:\\Users\\runneradmin\\AppData\\Roaming\\Python\\Scripts" >> $env:GITHUB_PATH

- name: Verify Poetry Installation
run: poetry --version

- name: Clear Poetry Cache
run: poetry cache clear pypi --all

- name: Install future
run: pip wheel --use-pep517 "future==0.18.3"

- name: Install dependencies
run: poetry install --all-extras --with dev --verbose

- name: Lint with ruff
run: make format_diff

- name: Spellcheck
run: make spell_check

- name: Run core tests
run: make test_core

- name: Run code coverage
continue-on-error: true
run: |
poetry run coverage run --source=pandasai -m pytest tests
poetry run coverage xml

- name: Report coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
35 changes: 21 additions & 14 deletions .github/workflows/ci.yml → .github/workflows/ci-extensions.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
name: ci
name: ci-extensions

on:
push:
branches: [main]
pull_request:

jobs:
build:
extensions-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.10", "3.11"]

steps:
- name: Clean up instance space
if: matrix.os != 'windows-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h

- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -25,25 +35,18 @@ jobs:
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV

- name: Install Poetry (Windows)
if: matrix.os == 'windows-latest'
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
echo "C:\\Users\\runneradmin\\AppData\\Roaming\\Python\\Scripts" >> $env:GITHUB_PATH

- name: Verify Poetry Installation
run: poetry --version

- name: Clear Poetry Cache
run: poetry cache clear pypi --all
- name: Install future
run: pip wheel --use-pep517 "future==0.18.3"
- name: Install dependencies
run: poetry install --all-extras --with dev --verbose
- name: Lint with ruff
run: make format_diff
- name: Spellcheck
run: make spell_check
- name: Run core tests
run: make test_core

# Install dependencies, test, and remove for each extension
- name: Install and test LLM extensions (Unix)
Expand Down Expand Up @@ -137,11 +140,15 @@ jobs:
Pop-Location
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test execution step is missing for enterprise extensions on Windows. Add poetry run pytest tests/ after installing dependencies.

}
- name: Run code coverage

- name: Run code coverage for extensions
continue-on-error: true
run: |
poetry run coverage run --source=pandasai,extensions -m pytest tests extensions/*/tests extensions/ee/*/tests --ignore=tests/integration_tests
poetry lock --no-update
poetry add coverage --dev
poetry run coverage run --source=extensions -m pytest tests extensions/*/tests
poetry run coverage xml

- name: Report coverage
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions examples/from_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@


import pandasai as pai
import pandasai_sql

df = pai.load("sipa/users")
response = df.chat("How many users in total?")
print(response)
print(response)
Loading
Loading