Skip to content

Commit 4668d91

Browse files
committed
chore(python): bump up default python support to 3.12
1 parent e2ab113 commit 4668d91

File tree

7 files changed

+25
-23
lines changed

7 files changed

+25
-23
lines changed

instill/helpers/commands/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ def validate_python_version(python_version: str) -> str:
4747
"""Validate Python version and return cleaned version string."""
4848
# Set default Python version if not provided
4949
if not python_version:
50-
python_version = "3.11"
50+
python_version = "3.12"
5151

5252
# Validate Python version format first
5353
try:
5454
version_parts = [int(x) for x in python_version.split(".")]
5555
if len(version_parts) < 2:
5656
raise ValueError(
57-
f"Invalid Python version format: {python_version}. Must be in format X.Y (e.g., 3.11)"
57+
f"Invalid Python version format: {python_version}. Must be in format X.Y (e.g., 3.12)"
5858
)
5959
except (ValueError, IndexError) as exc:
6060
raise ValueError(
61-
f"Invalid Python version format: {python_version}. Must be in format X.Y (e.g., 3.11)"
61+
f"Invalid Python version format: {python_version}. Must be in format X.Y (e.g., 3.12)"
6262
) from exc
6363

6464
# Then validate version range

instill/helpers/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1.7-labs
22

33
ARG RAY_VERSION=2.47.0
4-
ARG PYTHON_VERSION=-py311
4+
ARG PYTHON_VERSION=-py312
55
ARG CUDA_VERSION=-cu128
66

77
FROM rayproject/ray:${RAY_VERSION}${PYTHON_VERSION}${CUDA_VERSION}

instill/helpers/docker/Dockerfile.mlc-llm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1.7-labs
22

33
ARG RAY_VERSION=2.47.0
4-
ARG PYTHON_VERSION=-py311
4+
ARG PYTHON_VERSION=-py312
55
ARG CUDA_VERSION=-cu128
66
ARG DEVICE_TYPE=-cpu
77

@@ -14,7 +14,7 @@ FROM rayproject/ray:${RAY_VERSION}${PYTHON_VERSION}${CUDA_VERSION} AS base-cpu-a
1414
RUN pip install git-lfs
1515

1616
ARG MLC_LLM_VERSION=0.19.0
17-
ARG PYTHON_VERSION=-py311
17+
ARG PYTHON_VERSION=-py312
1818
RUN wget -nv "https://github.com/mlc-ai/package/releases/download/v0.9.dev0/mlc_ai_cpu-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_x86_64.whl" && \
1919
pip install "mlc_ai_cpu-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_x86_64.whl" && \
2020
rm "mlc_ai_cpu-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_x86_64.whl"
@@ -32,7 +32,7 @@ FROM rayproject/ray:${RAY_VERSION}${PYTHON_VERSION}${CUDA_VERSION} AS base-cpu-a
3232
RUN pip install git-lfs
3333

3434
ARG MLC_LLM_VERSION=0.19.0
35-
ARG PYTHON_VERSION=-py311
35+
ARG PYTHON_VERSION=-py312
3636
RUN wget -nv "https://github.com/instill-ai/package/releases/download/v0.9.dev0/mlc_ai_cpu-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_aarch64.whl" && \
3737
pip install "mlc_ai_cpu-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_aarch64.whl" && \
3838
rm "mlc_ai_cpu-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_aarch64.whl"
@@ -50,7 +50,7 @@ FROM rayproject/ray:${RAY_VERSION}${PYTHON_VERSION}${CUDA_VERSION} AS base-gpu-a
5050
RUN pip install git-lfs
5151

5252
ARG MLC_LLM_VERSION=0.19.0
53-
ARG PYTHON_VERSION=-py311
53+
ARG PYTHON_VERSION=-py312
5454
ARG CUDA_VERSION=-cu128
5555
RUN wget -nv "https://github.com/mlc-ai/package/releases/download/v0.9.dev0/mlc_ai_cu${CUDA_VERSION#-cu}-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_x86_64.whl" && \
5656
pip install "mlc_ai_cu${CUDA_VERSION#-cu}-${MLC_LLM_VERSION}-cp${PYTHON_VERSION#-py}-cp${PYTHON_VERSION#-py}-manylinux_2_28_x86_64.whl" && \

instill/helpers/docker/Dockerfile.transformers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1.7-labs
22

33
ARG RAY_VERSION=2.47.0
4-
ARG PYTHON_VERSION=-py311
4+
ARG PYTHON_VERSION=-py312
55
ARG CUDA_VERSION=-cu128
66
ARG DEVICE_TYPE=-cpu
77

instill/helpers/docker/Dockerfile.vllm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1.7-labs
22

33
ARG RAY_VERSION=2.47.0
4-
ARG PYTHON_VERSION=-py311
4+
ARG PYTHON_VERSION=-py312
55
ARG CUDA_VERSION=-cu128
66
ARG DEVICE_TYPE=-cpu
77

instill/helpers/init-templates/instill.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ build:
22
# (Required) Set to true if your model requires GPU.
33
gpu: true
44

5-
# (Optional) Python version, currently only support 3.11.
6-
python_version: "3.11"
5+
# (Optional) Python version
6+
# support >=3.9 and <3.13 and default to 3.12
7+
# python_version: "3.12"
78

89
# (Optional) CUDA version if `gpu` is set to true
9-
# support 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8
10-
cuda_version: "12.8"
10+
# support >=12.2 and <=12.8 and default to 12.8
11+
# cuda_version: "12.8"
1112

1213
# (Optional) A list of python packages in the format of {package-name}=={version}
1314
# python_packages:
14-
# - torch==2.3.1
15-
# - transformers==4.41.2
15+
# - numpy==1.21.0
16+
# - pandas==2.1.0
1617

1718
# (Optional) A list of system packages from apt package manager
1819
# system_packages:
19-
# - htop
20+
# - curl
2021
# - libglib2.0-0

instill/tests/test_cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,11 @@ def test_find_project_root_not_found(self):
560560
@pytest.mark.parametrize(
561561
"version,expected",
562562
[
563+
("3.12", "312"),
563564
("3.11", "311"),
564565
("3.10", "310"),
565566
("3.9", "39"),
566-
("", "311"), # Default
567+
("", "312"), # Default
567568
],
568569
)
569570
def test_validate_python_version_valid(self, version, expected):
@@ -619,7 +620,7 @@ def test_prepare_build_environment_cpu(self):
619620
build_params = {
620621
"gpu": False,
621622
"llm_runtime": "transformers",
622-
"python_version": "3.11",
623+
"python_version": "3.12",
623624
"system_packages": ["git", "curl"],
624625
"python_packages": ["numpy", "pandas"],
625626
}
@@ -640,7 +641,7 @@ def test_prepare_build_environment_cpu(self):
640641

641642
assert llm_runtime == "transformers"
642643
assert ray_version == "2.47.0"
643-
assert python_version == "-py311"
644+
assert python_version == "-py312"
644645
assert cuda_version == ""
645646
assert device_type == "-cpu"
646647
assert system_pkg_str == "git curl"
@@ -655,7 +656,7 @@ def test_prepare_build_environment_gpu(self):
655656
"gpu": True,
656657
"cuda_version": "12.8",
657658
"llm_runtime": "vllm",
658-
"python_version": "3.11",
659+
"python_version": "3.12",
659660
}
660661

661662
result = prepare_build_environment(build_params)
@@ -674,7 +675,7 @@ def test_prepare_build_environment_gpu(self):
674675

675676
assert llm_runtime == "vllm"
676677
assert ray_version == "2.47.0"
677-
assert python_version == "-py311"
678+
assert python_version == "-py312"
678679
assert cuda_version == "-cu128"
679680
assert device_type == "-gpu"
680681
assert system_pkg_str == ""
@@ -721,7 +722,7 @@ def test_prepare_build_command(self):
721722
False, # no_cache
722723
"transformers", # llm_runtime
723724
"2.47.0", # ray_version
724-
"-py311", # python_version
725+
"-py312", # python_version
725726
"", # cuda_version
726727
"-cpu", # device_type
727728
"numpy pandas", # python_pkg_str

0 commit comments

Comments
 (0)