Skip to content

Commit

Permalink
forgot that one
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikKaum committed Aug 22, 2024
1 parent 3397f08 commit b982f0f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 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 ..
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ 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: |
<<<<<<< HEAD
pytest --cov=outlines_core
=======
cd bindings/python && pytest --cov=src/outlines_core
>>>>>>> 39def93 (changes paths for tests)
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
Expand All @@ -60,7 +64,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 +80,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 @@ -10,8 +10,12 @@ build/
benchmarks/results
target/
*.so
.benchmarks
**/target/
**/dist/

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

0 comments on commit b982f0f

Please sign in to comment.