Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

feat(tests): cache file.

Amir Mehr0098e4e74316
diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml
index 6c1ddf576..46a1f676b 100644
--- a/.github/workflows/run_tests.yml
+++ b/.github/workflows/run_tests.yml
@@ -121,43 +121,36 @@ jobs:
- name: Run setup.py build
run: python setup.py build
-integration_test:
- name: Run Integration Tests
- runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: ["3.9"]
- steps:
- - uses: actions/checkout@v4
-
- - name: Set up python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Cache pip dependencies
- uses: actions/cache@v3
- with:
+ integration_test:
+ name: Run Integration Tests
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.9"]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up python ${{ matrix.python-version }}
+ uses: actions/setup-python@v5
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Cache pip dependencies
+ uses: actions/cache@v3
+ with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ runner.os }}-pip
-
- - name: Add directory to Python path
- run: echo "PYTHONPATH=$(python -c 'import sys; print(':'.join(sys.path))'):$(pwd)" >> $GITHUB_ENV
-
- - name: Install dependencies
- run: pip install -r requirements.txt
-
- - name: Install dev dependencies
- run: pip install -r requirements-dev.txt
-
- - name: Set up cache directory
- run: |
- mkdir -p ./cache
- ls -la cache
- echo "DSP_NOTEBOOK_CACHEDIR=$(pwd)/cache" >> $GITHUB_ENV
-
- - name: Run tests with pytest
- run: pytest -c tests_integration/pytest.ini tests_integration/
+ - name: Add directory to Python path
+ run: echo "PYTHONPATH=$(python -c 'import sys; print(":".join(sys.path))'):$(pwd)" >> $GITHUB_ENV
+ - name: Install dependencies
+ run: pip install -r requirements.txt
+ - name: Install dev dependencies
+ run: pip install -r requirements-dev.txt
+ - name: Set up cache directory
+ run: |
+ pwd ./cache
+ ls -la cache
+ echo "DSP_NOTEBOOK_CACHEDIR=$(pwd)/cache" >> $GITHUB_ENV
+ - name: Run tests with pytest
+ run: pytest -c tests_integration/pytest.ini tests_integration/
diff --git a/tests_integration/base.py b/tests_integration/base.py
index abdc81f4d..ef079d9e3 100644
--- a/tests_integration/base.py
+++ b/tests_integration/base.py
@@ -7,7 +7,6 @@ import pytest
class BaseIntegrationTestWithCache:
@pytest.fixture(autouse=True)
def setup(self) -> None:
- return
# Base directory for all DSPy modules
library_dir = Path(__file__).resolve().parent
base_dir = library_dir.parent