Skip to content

Commit

Permalink
[GSK-1763] Adding python 3.11 support
Browse files Browse the repository at this point in the history
Contributes to GSK-1762
  • Loading branch information
Hartorn committed Sep 21, 2023
1 parent b42ff78 commit 56a7d31
Show file tree
Hide file tree
Showing 7 changed files with 5,933 additions and 69 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/build_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,30 +123,30 @@ jobs:
run: ./gradlew :backend:integrationTest --info -Ptestcontainers

build-python:
name: "Python ${{ matrix.python-version }}${{ matrix.pydantic_v1 && ' (Pydantic V1)' || ''}} on ${{ matrix.os }}${{matrix.experimental && ' (Non failing)' || '' }}"
name: "Python ${{ matrix.python-version }}${{ matrix.pydantic_v2 && ' (Pydantic V2)' || ''}} on ${{ matrix.os }}${{matrix.experimental && ' (Non failing)' || '' }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Do not stop when any job fails
matrix:
python-version: [ "3.8", "3.9", "3.10" ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
os: [ubuntu-latest]
experimental: [false]
pydantic_v1: [false]
pydantic_v2: [false]
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
include:
- python-version: "3.10"
os: windows-2019
experimental: false
pydantic_v1: false
pydantic_v2: false
- python-version: "3.10"
os: ubuntu-latest
experimental: false
pydantic_v1: true
os: windows-2022
pydantic_v2: false
- python-version: "3.10"
os: macos-latest
experimental: false
pydantic_v1: false
continue-on-error: ${{ matrix.experimental }} # https://ncorti.com/blog/howto-github-actions-build-matrix
pydantic_v2: false
- python-version: "3.10"
os: ubuntu-latest
pydantic_v2: true

continue-on-error: false # https://ncorti.com/blog/howto-github-actions-build-matrix
steps:
- name: Checkout code
uses: actions/[email protected]
Expand Down Expand Up @@ -184,23 +184,23 @@ jobs:
working-directory: python-client
run: pdm run lint

- name: Install pydantic v1
if: ${{ matrix.pydantic_v1 }}
- name: Install pydantic v2
if: ${{ matrix.pydantic_v2 }}
working-directory: python-client
run: |
pdm run pip uninstall pydantic pydantic_core -y
pdm run pip install "pydantic<2"
pdm run pip install "pydantic>=2<3"
- name: Check Pydantic installed version
working-directory: python-client
run: |
pdm run pip freeze | grep '^pydantic'
pdm run pip freeze | grep -q '^pydantic==${{ matrix.pydantic_v1 && '1' || '2' }}\.'
pdm run pip freeze | grep -q '^pydantic==${{ matrix.pydantic_v2 && '2' || '1' }}\.'
- name: Test code
working-directory: python-client
env:
PYTEST_XDIST_AUTO_NUM_WORKERS: ${{ matrix.os == 'windows-2019' && 1 || 2 }}
PYTEST_XDIST_AUTO_NUM_WORKERS: ${{ startsWith(matrix.os,'windows-') && 1 || 2 }}
run: pdm run test-fast

- name: Build doc
Expand Down
1 change: 1 addition & 0 deletions python-client/giskard/ml_worker/websocket/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def on_message(self, frame):
def on_ml_worker_get_info(ml_worker: MLWorker, params: GetInfoParam, *args, **kwargs) -> websocket.GetInfo:
logger.info("Collecting ML Worker info from WebSocket")

# TODO(Bazire): seems to be deprecated https://setuptools.pypa.io/en/latest/pkg_resources.html#workingset-objects
installed_packages = (
{p.project_name: p.version for p in pkg_resources.working_set} if params.list_packages else None
)
Expand Down
Loading

0 comments on commit 56a7d31

Please sign in to comment.