Skip to content

Commit

Permalink
Add python 3.12 support and remove python 3.8 support (kserve#3645)
Browse files Browse the repository at this point in the history
* Support python 3.12

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Update dependencies

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Update deps to support 3.12

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Remove python 3.8 support

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Remove skip for infer client test

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Fix port forward

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Fix sklearn pandas dep

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* skip pydantic v1 test for py 3.12

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Add setuptools dep for pmml

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Fix lgb

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Include setuptools for paddle

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Include setuptools for huggingface

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Rebase

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

* Rebase

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>

---------

Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
  • Loading branch information
sivanantha321 authored Oct 6, 2024
1 parent ecc3729 commit 24d882b
Show file tree
Hide file tree
Showing 31 changed files with 10,553 additions and 8,298 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down Expand Up @@ -98,29 +98,33 @@ jobs:
# ----------------------------------------Kserve Pydantic V1 Unit Tests--------------------------------------------
- name: Setup kserve pydantic v1 directory
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.12') }}
run: |
mkdir -p python/kserve-pydantic-v1
cp -r python/kserve/* python/kserve-pydantic-v1
cd python/kserve-pydantic-v1
# update the lock file without installing dependencies
poetry update "pydantic<2.0" --lock
- name: Load cached kserve pydantic v1 venv
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.12') }}
id: cached-kserve-pydantic-v1-dependencies
uses: actions/cache@v3
with:
path: python/kserve-pydantic-v1/.venv
key: kserve-pydantic-v1-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/kserve-pydantic-v1/poetry.lock') }}
# install kserve pydantic v1 dependencies if cache does not exist
- name: Install kserve pydantic v1 dependencies
if: steps.cached-kserve-pydantic-v1-dependencies.outputs.cache-hit != 'true'
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.12') && steps.cached-kserve-pydantic-v1-dependencies.outputs.cache-hit != 'true' }}
run: |
cd python/kserve-pydantic-v1
make install_dependencies
- name: Install kserve pydantic v1
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.12') }}
run: |
cd python/kserve-pydantic-v1
make dev_install
- name: Test kserve pydantic v1
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.12') }}
run: |
cd python
source kserve-pydantic-v1/.venv/bin/activate
Expand Down Expand Up @@ -250,33 +254,28 @@ jobs:
# ----------------------------------------Huggingface Server Unit Tests------------------------------------------------
# load cached huggingface venv if cache exists
- name: Load cached huggingface venv
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.8') }}
id: huggingface-dependencies
uses: actions/cache@v4
with:
path: /mnt/python/huggingfaceserver-venv
key: huggingface-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/kserve/poetry.lock', '**/huggingfaceserver/poetry.lock') }}
# install huggingface server dependencies if cache does not exist
- name: Configure poetry for huggingface server
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.8') }}
run: |
poetry config virtualenvs.path /mnt/python/huggingfaceserver-venv
poetry config virtualenvs.in-project false
- name: Install huggingface dependencies
if: ${{ steps.cached-huggingface-dependencies.outputs.cache-hit != 'true' && !startsWith(steps.setup-python.outputs.python-version, '3.8') }}
run: |
sudo mkdir -p /mnt/python/huggingfaceserver-venv
# change permission so that poetry can install without sudo
sudo chown -R $USER /mnt/python/huggingfaceserver-venv
cd python/huggingfaceserver
make install_dependencies
- name: Install huggingface server
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.8') }}
run: |
cd python/huggingfaceserver
make dev_install
- name: Test huggingfaceserver
if: ${{ !startsWith(steps.setup-python.outputs.python-version, '3.8') }}
run: |
cd python/huggingfaceserver
poetry run -- pytest --cov=huggingfaceserver -vv
Expand Down
1,932 changes: 1,265 additions & 667 deletions python/aiffairness/poetry.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions python/aiffairness/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
python = ">=3.9,<3.13"
kserve = {path = "../kserve", develop = true}
aif360 = "^0.2.3"
nest-asyncio = "^1.4.0"
aif360 = "^0.6.1"
nest-asyncio = "^1.5.8"
requests = {version = "^2.24.0", extras = ["security"]}

[tool.poetry.group.test]
optional = true

[tool.poetry.group.test.dependencies]
pytest = "^7.2.0"
pytest-cov = "^4.0.0"
pytest = "^7.4.4"
pytest-cov = "^5.0.0"
mypy = "^0.991"

[tool.poetry.group.dev]
Expand Down
1,449 changes: 785 additions & 664 deletions python/artexplainer/poetry.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions python/artexplainer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
python = ">=3.9,<3.13"
kserve = {path = "../kserve", develop = true}
adversarial-robustness-toolbox = {version = "^1.10.3", extras = ["keras"]}
nest-asyncio = "^1.4.0"
adversarial-robustness-toolbox = {version = "^1.18.1", extras = ["keras"]}
nest-asyncio = "^1.5.8"
pillow = "^10.3.0"
# pin to avoid https://github.com/kserve/kserve/actions/runs/8990775750/job/24696874468?pr=3598
h5py = "3.10.0"
Expand All @@ -22,8 +22,8 @@ h5py = "3.10.0"
optional = true

[tool.poetry.group.test.dependencies]
pytest = "^7.2.0"
pytest-cov = "^4.0.0"
pytest = "^7.4.4"
pytest-cov = "^5.0.0"
mypy = "^0.991"

[tool.poetry.group.dev]
Expand Down
Loading

0 comments on commit 24d882b

Please sign in to comment.