Skip to content

Commit a3541d1

Browse files
committed
Verify Wheel Build and SDist Test in PR Tests Workflow
1 parent 3a7d83b commit a3541d1

File tree

3 files changed

+32
-23
lines changed

3 files changed

+32
-23
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Build sdist and wheel
4+
python -m pip install -U pip
5+
python -m pip install build
6+
python -m build
7+
8+
# Check sdist install and imports
9+
mkdir -p test-sdist
10+
cd test-sdist
11+
python -m venv venv-sdist
12+
venv-sdist/bin/python -m pip install ../dist/outlines-*.tar.gz
13+
venv-sdist/bin/python -c "import outlines"
14+
cd ..
15+
16+
# Check wheel install and imports
17+
mkdir -p test-wheel
18+
cd test-wheel
19+
python -m venv venv-wheel
20+
venv-wheel/bin/python -m pip install ../dist/outlines-*.whl
21+
venv-wheel/bin/python -c "import outlines"
22+
cd ..

.github/workflows/release_pypi.yaml

+2-23
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,11 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v2
14-
- name: Set up Python
15-
uses: actions/setup-python@v2
16-
with:
17-
python-version: "3.10"
18-
- name: Build sdist and wheel
19-
run: |
20-
python -m pip install -U pip
21-
python -m pip install build
22-
python -m build
14+
- name: Build SDist and Wheel
15+
run: ./.github/scripts/build_sdist_and_wheel.sh
2316
- name: Check that the package version matches the Release name
2417
run: |
2518
grep -Rq "^Version: ${GITHUB_REF:10}$" outlines.egg-info/PKG-INFO
26-
- name: Check sdist install and imports
27-
run: |
28-
mkdir -p test-sdist
29-
cd test-sdist
30-
python -m venv venv-sdist
31-
venv-sdist/bin/python -m pip install ../dist/outlines-*.tar.gz
32-
venv-sdist/bin/python -c "import outlines"
33-
- name: Check wheel install and imports
34-
run: |
35-
mkdir -p test-wheel
36-
cd test-wheel
37-
python -m venv venv-wheel
38-
venv-wheel/bin/python -m pip install ../dist/outlines-*.whl
39-
venv-wheel/bin/python -c "import outlines"
4019
- name: Publish to PyPi
4120
uses: pypa/gh-action-pypi-publish@v1.4.2
4221
with:

.github/workflows/tests.yml

+8
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,11 @@ jobs:
8888
name: html-report
8989
path: htmlcov
9090
if: ${{ failure() }}
91+
92+
build-wheel:
93+
name: Build Wheel and Test SDist
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v3
97+
- name: Build SDist and Wheel
98+
run: ./.github/scripts/build_sdist_and_wheel.sh

0 commit comments

Comments
 (0)