Skip to content

Commit

Permalink
changes paths for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikKaum committed Aug 20, 2024
1 parent 8dd9e91 commit 39def93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .github/scripts/build_sdist_and_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@
# Build sdist and wheel
python -m pip install -U pip
python -m pip install build
cd bindings/python
ln -sf ../../outlines-core outlines-core-lib
sed -i '' 's|path = "../../outlines-core"|path = "outlines-core-lib"|' Cargo.toml
python -m build
cd ../..


# Check sdist install and imports
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/outlines_core-*.tar.gz
venv-sdist/bin/python -m pip install ../bindings/python/dist/outlines_core-*.tar.gz
venv-sdist/bin/python -c "import outlines_core"
cd ..

# Check wheel install and imports
mkdir -p test-wheel
cd test-wheel
python -m venv venv-wheel
venv-wheel/bin/python -m pip install ../dist/outlines_core-*.whl
venv-wheel/bin/python -m pip install ../bindings/python/dist/outlines_core-*.whl
venv-wheel/bin/python -c "import outlines_core"
cd ..
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
- name: Set up test environment
run: |
python -m pip install --upgrade pip
pip install .[test]
cd bindings/python && pip install '.[test]'
- name: Run tests
run: |
pytest --cov=src/outlines_core
cd bindings/python && pytest --cov=src/outlines_core
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
Expand All @@ -60,7 +60,7 @@ jobs:

- name: Set up environment
run: |
pip install --upgrade "coverage[toml]>=5.1" diff-cover
cd bindgins/python && pip install --upgrade "coverage[toml]>=5.1" diff-cover
- uses: actions/download-artifact@v3
with:
Expand All @@ -76,10 +76,10 @@ jobs:
# python -m coverage combine
# Produce an html report with absolute coverage information
python -m coverage html --skip-covered --skip-empty
cd bindgins/python && python -m coverage html --skip-covered --skip-empty
# Report relative coverage and write to the workflow's summary
python -m coverage xml
cd bindings/python && python -m coverage xml
diff-cover coverage.xml --markdown-report=coverage.md --fail-under=100 || (cat coverage.md >> $GITHUB_STEP_SUMMARY && exit 1)
- name: Upload HTML report if check failed.
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ docs/build
*.gguf
.venv
benchmarks/results
.benchmarks
**/target/
**/dist/

bindings/python/build
bindings/python/src/outlines_core
bindings/python/outlines-core-lib
test-sdist/
test-wheel/

0 comments on commit 39def93

Please sign in to comment.