enhance: upgrade test Python runtime to 3.12 (#49622)

issue: #49516

### What changed

- Upgrade test runtime pins and Docker base images to Python 3.12.
- Update tests ruff target and Python-version docs to 3.12.
- Refresh Python client dependency pins that block Python 3.12
installation.
- Scope TestPyPI lookup to pymilvus via find-links so uv does not
require unsafe-best-match.
- Suppress third-party invalid escape sequence SyntaxWarning noise seen
during Python 3.12 pytest collection.

### Verification

- git diff --check
- uv pip install --python /tmp/milvus-tests-py312-uv-default/bin/python
--dry-run -r tests/python_client/requirements.txt
- python3.12 -m venv /tmp/milvus-tests-py312-pip-requirements && pip
install -r tests/python_client/requirements.txt --timeout 30 --retries 6
- pip check
- python -c 'import pymilvus, ujson; print(pymilvus.__version__,
ujson.__version__)'
- python -m pytest --collect-only -q
milvus_client/test_milvus_client_collection.py

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing
2026-05-11 10:08:09 +08:00
committed by GitHub
parent 0a139eba29
commit ff42b9502e
11 changed files with 19 additions and 18 deletions
+2 -2
View File
@@ -51,9 +51,9 @@ jobs:
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Setup Python environment
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '<3.12'
python-version: '3.12'
- name: Install CMake 3.31.8
run: |
cmake --version || true
+1 -1
View File
@@ -1 +1 @@
3.10
3.12
+1 -1
View File
@@ -105,7 +105,7 @@ $ ruff format . # format in place
$ ruff format --check . # format check only (CI-friendly)
```
Rules enabled: `E`, `F`, `W`, `I`, `UP`. Target Python version: `3.10`.
Rules enabled: `E`, `F`, `W`, `I`, `UP`. Target Python version: `3.12`.
#### Lint only PR-changed files (Python Lint CI parity)
+1 -1
View File
@@ -104,7 +104,7 @@ $ ruff format . # 原地格式化
$ ruff format --check . # 只检查不修改 (CI 友好)
```
启用的规则:`E``F``W``I``UP`;目标 Python 版本:`3.10`
启用的规则:`E``F``W``I``UP`;目标 Python 版本:`3.12`
#### 仅检查 PR 修改的文件 (与 Python Lint CI 一致)
+1 -1
View File
@@ -9,7 +9,7 @@
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
FROM python:3.8-buster
FROM python:3.12-bullseye
RUN apt-get update && apt-get install -y jq
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.10-bullseye
FROM python:3.12-bullseye
RUN apt-get update && apt-get install -y jq
+1 -1
View File
@@ -73,7 +73,7 @@ $ kind export logs .
### PyMilvus Test Environment Deployment and Case Execution
We recommend using Python 3 (3.8 or higher), consistent with the version supported by PyMilvus.
We recommend using Python 3.12, consistent with the Python client CI runtime.
> Note: Procedures listed below will be completed automatically if you deployed Milvus using KinD.
+1 -1
View File
@@ -65,7 +65,7 @@ Milvus 支持4种部署方式,请根据需求选择部署方式,PyMilvus 支
### PyMilvus 测试环境部署及用例执行
推荐使用 **Python 3(>= 3.8)** ,与 **[PyMilvus](https://pymilvus.readthedocs.io/en/latest/install.html)** 支持的 Python 版本保持一致。
推荐使用 **Python 3.12**,与 Python client CI 运行环境保持一致。
> **_NOTE:_** 如选择KinD部署方式,以下步骤可以自动完成
+1
View File
@@ -12,6 +12,7 @@ markers =
filterwarnings =
ignore::DeprecationWarning
ignore:invalid escape sequence:SyntaxWarning
asyncio_default_fixture_loop_scope = function
timeout_method = thread
+8 -8
View File
@@ -1,8 +1,8 @@
--extra-index-url https://test.pypi.org/simple/
--find-links https://test.pypi.org/simple/pymilvus/
pytest-cov==2.8.1
requests>=2.32.4
scikit-learn>=1.5.2
ujson==5.5.0
ujson==5.10.0
pytest==8.3.4
pytest-asyncio==0.24.0
pytest-timeout==1.3.3
@@ -18,7 +18,7 @@ pytest_tagging==1.6.0
pytest-html==3.1.1
delayed-assert==0.3.5
kubernetes==17.17.0
PyYAML==6.0
PyYAML==6.0.2
pytest-sugar==0.9.5
pytest-random-order
@@ -37,14 +37,14 @@ npy-append-array==0.9.15
Faker==19.2.0
# for benchmark
h5py==3.8.0
h5py==3.11.0
# for log
loguru==0.7.0
# util
psutil==5.9.4
pandas==1.5.3
psutil==5.9.8
pandas==2.2.3
numpy==1.26.4
tenacity==8.1.0
rich==13.7.0
@@ -55,10 +55,10 @@ deepdiff==8.6.1
# for test result analyzer
prettytable==3.8.0
pyarrow==14.0.1
fastparquet==2023.7.0
fastparquet==2024.11.0
# for bf16 datatype
ml-dtypes==0.2.0
ml-dtypes==0.5.1
# for text processing
Unidecode==1.3.8
+1 -1
View File
@@ -1,5 +1,5 @@
line-length = 120
target-version = "py310"
target-version = "py312"
extend-exclude = [
".venv",
"__pycache__",