Skip to content

Commit

Permalink
Adjust supported python versions to ^3.8 (#312)
Browse files Browse the repository at this point in the history
## Problem

Extend test coverage for python 3.11 and 3.12. Adjust pyproject.toml
python dependency to `^3.8` to ease some installation problems in
projects which depend on us.

## Solution

Tweak test matrix to add coverage for 3.11 and 3.12. Adjust
pyproject.toml to reflect specific version deps for grpcio and urllib3.

## Type of Change

- [x] New feature (non-breaking change which adds functionality)
- [x] Infrastructure change (CI configs, etc)

## Test Plan

Describe specific steps for validating this change.
  • Loading branch information
jhamon committed Feb 22, 2024
1 parent 17b33e7 commit 0d3cc45
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 107 deletions.
6 changes: 5 additions & 1 deletion .github/actions/test-data-plane/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
PINECONE_API_KEY:
description: 'The Pinecone API key'
required: true
python_version:
description: 'The version of Python to use'
required: false
default: '3.9'

outputs:
index_name:
Expand All @@ -37,7 +41,7 @@ runs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: ${{ inputs.python_version }}

- name: Setup Poetry
uses: ./.github/actions/setup-poetry
Expand Down
66 changes: 66 additions & 0 deletions .github/actions/test-dependency-grpc/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'Test GRPC Dependencies'
description: 'Runs sanity test with specific gRPC dependencies'

inputs:
PINECONE_API_KEY:
description: 'The Pinecone API key'
required: true
index_name:
description: 'The name of the index'
required: true
python_version:
description: 'The version of Python to use'
required: false
default: '3.9'
grpcio_version:
description: 'The version of grpcio to install'
required: true
lz4_version:
description: 'The version of lz4 to install'
required: true
protobuf_version:
description: 'The version of protobuf to install'
required: true
googleapis_common_protos_version:
description: 'The version of googleapis-common-protos to install'
required: true

runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: Setup Poetry
uses: ./.github/actions/setup-poetry
with:
include_grpc: true
include_types: false

- name: Install grpcio ${{ inputs.grpcio_version }}
run: poetry add grpcio==${{ inputs.grpcio_version }}
shell: bash

- name: Install lz4 ${{ inputs.lz4_version }}
run: poetry add lz4==${{ inputs.lz4_version }}
shell: bash

- name: Install protobuf ${{ inputs.protobuf_version }}
run: poetry add protobuf==${{ inputs.protobuf_version }}
shell: bash

- name: Install googleapis-common-protos ${{ inputs.googleapis_common_protos_version }}
run: poetry add googleapis-common-protos==${{ inputs.googleapis_common_protos_version }}
shell: bash

- uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
retry_on: error
command: poetry run pytest tests/dependency/grpc -s -v
env:
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
INDEX_NAME: ${{ inputs.index_name }}
45 changes: 45 additions & 0 deletions .github/actions/test-dependency-rest/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Test REST Dependencies'
description: 'Runs sanity test with specific REST dependencies'

inputs:
PINECONE_API_KEY:
description: 'The Pinecone API key'
required: true
index_name:
description: 'The name of the index'
required: true
python_version:
description: 'The version of Python to use'
required: false
default: '3.9'
urllib3_version:
description: 'The version of urllib3 to install'
required: true

runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: Setup Poetry
uses: ./.github/actions/setup-poetry
with:
include_grpc: false
include_types: false

- name: 'Install urllib3 ${{ matrix.urllib3-version }}'
run: 'poetry add urllib3==${{ matrix.urllib3-version }}'
shell: bash

- uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
retry_on: error
command: poetry run pytest tests/dependency/rest -s -v
env:
PINECONE_API_KEY: '${{ inputs.PINECONE_API_KEY }}'
INDEX_NAME: '${{ inputs.index_name }}'
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
python-version: [3.8, 3.12]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
146 changes: 82 additions & 64 deletions .github/workflows/testing-dependency.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ jobs:
needs: dependency-matrix-setup
runs-on: ubuntu-latest
strategy:
max-parallel: 5
max-parallel: 10
fail-fast: false
matrix:
python-version:
python_version:
- 3.8
# - 3.9
# - "3.10"
# - 3.11
grpcio-version:
- 3.9
- "3.10"
grpcio_version:
- 1.44.0
# - 1.46.5
# - 1.47.5
Expand All @@ -49,94 +48,113 @@ jobs:
# - 1.58.0
# - 1.59.3
- 1.60.0
lz4-version:
lz4_version:
- 3.1.3
# - 3.1.10
- 4.0.0
# - 4.0.1
# - 4.1.0
- 4.3.3
protobuf-version:
protobuf_version:
- 3.20.3
googleapis-common-protos-version:
googleapis_common_protos_version:
- 1.53.0
- 1.62.0
grpc-gateway-protoc-gen-openapiv2-version:
grpc_gateway_protoc_gen_openapiv2_version:
- 0.1.0

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
uses: ./.github/actions/setup-poetry
- uses: ./.github/actions/test-dependency-grpc
with:
include_grpc: true
include_types: false
- name: Install grpcio ${{ matrix.grpcio-version }}
run: poetry add grpcio==${{ matrix.grpcio-version }}
- name: Install lz4 ${{ matrix.lz4-version }}
run: poetry add lz4==${{ matrix.lz4-version }}
- name: Install protobuf ${{ matrix.protobuf-version }}
run: poetry add protobuf==${{ matrix.protobuf-version }}
- name: Install googleapis-common-protos ${{ matrix.googleapis-common-protos-version }}
run: poetry add googleapis-common-protos==${{ matrix.googleapis-common-protos-version }}
python_version: '${{ matrix.python_version }}'
index_name: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
grpcio_version: '${{ matrix.grpcio_version }}'
lz4_version: '${{ matrix.lz4_version }}'
protobuf_version: '${{ matrix.protobuf_version }}'
googleapis_common_protos_version: '${{ matrix.googleapis_common_protos_version }}'

- uses: nick-fields/retry@v3
dependency-matrix-grpc-312:
name: Deps (GRPC)
needs: dependency-matrix-setup
runs-on: ubuntu-latest
strategy:
max-parallel: 10
fail-fast: false
matrix:
python_version:
- 3.11
- 3.12
grpcio_version:
- 1.59.3
- 1.60.0
lz4_version:
- 3.1.3
- 4.3.3
protobuf_version:
- 3.20.3
googleapis_common_protos_version:
- 1.53.0
- 1.62.0
grpc_gateway_protoc_gen_openapiv2_version:
- 0.1.0
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test-dependency-grpc
with:
timeout_minutes: 5
max_attempts: 3
retry_on: error
command: poetry run pytest tests/dependency/grpc -s -v
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
INDEX_NAME: ${{ needs.dependency-matrix-setup.outputs.index_name }}



python_version: '${{ matrix.python_version }}'
index_name: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
grpcio_version: '${{ matrix.grpcio_version }}'
lz4_version: '${{ matrix.lz4_version }}'
protobuf_version: '${{ matrix.protobuf_version }}'
googleapis_common_protos_version: '${{ matrix.googleapis_common_protos_version }}'

dependency-matrix-rest:
name: Deps (REST)
runs-on: ubuntu-latest
needs: dependency-matrix-setup
strategy:
max-parallel: 5
max-parallel: 10
fail-fast: false
matrix:
python-version:
python_version:
- 3.8
- 3.9
- '3.10'
- 3.11
urllib3-version:
urllib3_version:
- 1.26.0
- 1.26.18
- 2.0.2
- 2.0.5
- 2.1.0
- 2.2.1
steps:
- uses: actions/checkout@v4
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v5
- uses: ./.github/actions/test-dependency-rest
with:
python-version: '${{ matrix.python-version }}'
- name: Setup Poetry
uses: ./.github/actions/setup-poetry
with:
include_grpc: false
include_types: false
- name: 'Install urllib3 ${{ matrix.urllib3-version }}'
run: 'poetry add urllib3==${{ matrix.urllib3-version }}'
- uses: nick-fields/retry@v3
python_version: '${{ matrix.python_version }}'
index_name: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
urllib3_version: '${{ matrix.urllib3_version }}'

dependency-matrix-rest-312:
name: Deps (REST)
runs-on: ubuntu-latest
needs: dependency-matrix-setup
strategy:
max-parallel: 10
fail-fast: false
matrix:
python_version:
- 3.12
urllib3_version:
- 1.26.5
- 1.26.18
- 2.0.2
- 2.2.1
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test-dependency-rest
with:
timeout_minutes: 5
max_attempts: 3
retry_on: error
command: poetry run pytest tests/dependency/rest -s -v
env:
python_version: '${{ matrix.python_version }}'
index_name: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'
INDEX_NAME: '${{ needs.dependency-matrix-setup.outputs.index_name }}'
urllib3_version: '${{ matrix.urllib3_version }}'
9 changes: 4 additions & 5 deletions .github/workflows/testing-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: [3.8, 3.12]
use_grpc: [true, false]
metric:
- cosine
Expand All @@ -20,6 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/test-data-plane
with:
python_version: '${{ matrix.python_version }}'
use_grpc: '${{ matrix.use_grpc }}'
metric: '${{ matrix.metric }}'
spec: '${{ matrix.spec }}'
Expand Down Expand Up @@ -55,7 +57,7 @@ jobs:
testConfig:
- python-version: 3.8
pod: { environment: 'us-east1-gcp'}
- python-version: 3.11
- python-version: 3.12
pod: { environment: 'us-east4-gcp'}
fail-fast: false
steps:
Expand Down Expand Up @@ -88,9 +90,6 @@ jobs:
DIMENSION: 1536
METRIC: 'cosine'




control-rest-serverless:
name: control plane serverless
runs-on: ubuntu-latest
Expand All @@ -102,7 +101,7 @@ jobs:
- python-version: 3.8 # Do one test run with 3.8 for sanity check
pod: { environment: 'us-east1-gcp'}
serverless: { cloud: 'aws', region: 'us-west-2'}
- python-version: 3.11
- python-version: 3.12
pod: { environment: 'us-east1-gcp'}
serverless: { cloud: 'aws', region: 'us-west-2'}
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/testing-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- 3.9
- '3.10'
- 3.11
- 3.12
use_grpc:
- true
- false
Expand Down

0 comments on commit 0d3cc45

Please sign in to comment.