Installation testing #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Installation Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
test-install: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python: [3.9] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install build tools | |
run: | | |
python -m pip install --upgrade pip setuptools wheel build | |
- name: Build sdist & wheel | |
run: python -m build --sdist --wheel | |
- name: Install from built artifacts | |
run: | | |
python - <<EOF | |
import glob | |
import os | |
import subprocess | |
# Find wheel and sdist files | |
wheels = glob.glob('dist/*.whl') | |
sdists = glob.glob('dist/*.tar.gz') | |
# Try wheel first, then sdist | |
if wheels: | |
subprocess.check_call(['pip', 'install', wheels[0]]) | |
elif sdists: | |
subprocess.check_call(['pip', 'install', sdists[0]]) | |
else: | |
raise Exception("No wheel or sdist found in dist/") | |
EOF | |
- name: Verify import & version | |
run: | | |
python - <<EOF | |
import pinecone | |
print("Imported OK, version:", pinecone.__version__) | |
EOF |