Skip to content

Commit 6f84c2c

Browse files
RaysilienceXuanYang-cn
authored andcommitted
feat: disable installation of milvus-lite on windows platform
Since the project is managed by setuptools, and according to the [setuptools](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html), we can disable the automatic installation of milvus-lite on windows platform by adding environment markers. Following [PEP508](https://peps.python.org/pep-0508/), I pick the environment marker "sys_platform != 'win32'" to prevent the installation. I build packages after the modification. Then test the .tar.gz and the .whl files both on my windows laptop and a linux docker. The issue mentioned in milvus-io#2131 seems gone. Due the lack of macOS machine, I could not perform testing on that particular platform. Please check validity before merging. enhance: Check PyMilvus on Windows platform See also: milvus-io#2131, milvus-io#2134, milvus-io#2131 Co-Authored-by: rui zhang <[email protected]> Signed-off-by: yangxuan <[email protected]>
1 parent c9f87bc commit 6f84c2c

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

.github/workflows/check_milvus_proto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install -e .
29+
pip install -e ".[dev]"
3030
3131
- name: Try generate proto
3232
run: |

.github/workflows/code_checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
22-
- name: check pyproject.toml install
22+
- name: Check pyproject.toml install
2323
run: |
2424
pip install -e .
2525
- name: Install requirements

.github/workflows/pull_request.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ on:
88
jobs:
99
build:
1010
name: Run Python Tests
11-
runs-on: ubuntu-latest
1211
strategy:
1312
matrix:
1413
python-version: [3.8, 3.12]
14+
os: [ubuntu-latest, windows-latest]
15+
runs-on: ${{ matrix.os }}
1516

1617
steps:
1718
- name: Checkout code

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ get_proto:
2525
git submodule update --init
2626

2727
gen_proto:
28-
python3 -m pip install -e ".[dev]"
28+
pip install -e ".[dev]"
2929
cd pymilvus/grpc_gen && ./python_gen.sh
3030

3131
check_proto_product: gen_proto

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dependencies=[
2525
"pandas>=1.2.4",
2626
"numpy<1.25.0;python_version<='3.8'",
2727
"milvus_lite>=2.4.0,<2.5.0",
28+
"milvus-lite>=2.4.0,<2.5.0;sys_platform!='win32'",
2829
]
2930

3031
classifiers=[

tests/test_milvus_lite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import os
2+
import sys
23
from tempfile import TemporaryDirectory
34
import numpy as np
5+
import pytest
46

57
from pymilvus.milvus_client import MilvusClient
68

79

10+
@pytest.mark.skipif(sys.platform.startswith('win'), reason="Milvus Lite is not supported on Windows")
811
class TestMilvusLite:
9-
1012
def test_milvus_lite(self):
1113
with TemporaryDirectory(dir='./') as root:
1214
db_file = os.path.join(root, 'test.db')

0 commit comments

Comments
 (0)