|
| 1 | +name: Installation Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + workflow_dispatch: |
| 6 | + pull_request: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + pull-requests: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + test-install-linux: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + python: [3.9, 3.10, 3.11, 3.12, 3.13] |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout code |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Set up Python ${{ matrix.python }} |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python }} |
| 27 | + |
| 28 | + - name: Install build tools |
| 29 | + run: | |
| 30 | + python -m pip install --upgrade pip setuptools wheel build |
| 31 | +
|
| 32 | + - name: Build sdist & wheel |
| 33 | + run: python -m build --sdist --wheel |
| 34 | + |
| 35 | + - name: Install from built artifacts |
| 36 | + shell: bash |
| 37 | + run: | |
| 38 | + pip install dist/*.whl || pip install dist/*.tar.gz |
| 39 | +
|
| 40 | + - name: Verify import & version |
| 41 | + run: | |
| 42 | + python - <<EOF |
| 43 | + import pinecone |
| 44 | + print("Imported OK, version:", pinecone.__version__) |
| 45 | + EOF |
| 46 | +
|
| 47 | + test-install-windows: |
| 48 | + runs-on: windows-latest |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + python: [3.9, 3.10, 3.11, 3.12, 3.13] |
| 52 | + steps: |
| 53 | + - name: Checkout code |
| 54 | + uses: actions/checkout@v4 |
| 55 | + |
| 56 | + - name: Set up Python ${{ matrix.python }} |
| 57 | + uses: actions/setup-python@v5 |
| 58 | + with: |
| 59 | + python-version: ${{ matrix.python }} |
| 60 | + |
| 61 | + - name: Install build tools |
| 62 | + run: | |
| 63 | + python -m pip install --upgrade pip setuptools wheel build |
| 64 | +
|
| 65 | + - name: Build sdist & wheel |
| 66 | + run: python -m build --sdist --wheel |
| 67 | + |
| 68 | + - name: Install from built artifacts |
| 69 | + shell: pwsh |
| 70 | + run: | |
| 71 | + $wheels = Get-ChildItem -Path "dist" -Filter "*.whl" |
| 72 | + $sdists = Get-ChildItem -Path "dist" -Filter "*.tar.gz" |
| 73 | + if ($wheels) { |
| 74 | + pip install $wheels[0].FullName |
| 75 | + } |
| 76 | + elseif ($sdists) { |
| 77 | + pip install $sdists[0].FullName |
| 78 | + } |
| 79 | + else { |
| 80 | + throw "No wheel or sdist found in dist/" |
| 81 | + } |
| 82 | +
|
| 83 | + - name: Verify import & version |
| 84 | + shell: pwsh |
| 85 | + run: | |
| 86 | + python -c "import pinecone; print('Imported OK, version:', pinecone.__version__)" |
0 commit comments