Skip to content

Commit

Permalink
feat: disable installation of milvus-lite on windows platform
Browse files Browse the repository at this point in the history
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 #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: #2131, #2134, #2131

Co-Authored-by: rui zhang <[email protected]>
Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
2 people authored and XuanYang-cn committed Jun 17, 2024
1 parent c9f87bc commit 6f84c2c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_milvus_proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e ".[dev]"
- name: Try generate proto
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: check pyproject.toml install
- name: Check pyproject.toml install
run: |
pip install -e .
- name: Install requirements
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
jobs:
build:
name: Run Python Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.12]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ get_proto:
git submodule update --init

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

check_proto_product: gen_proto
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies=[
"pandas>=1.2.4",
"numpy<1.25.0;python_version<='3.8'",
"milvus_lite>=2.4.0,<2.5.0",
"milvus-lite>=2.4.0,<2.5.0;sys_platform!='win32'",
]

classifiers=[
Expand Down
4 changes: 3 additions & 1 deletion tests/test_milvus_lite.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import os
import sys
from tempfile import TemporaryDirectory
import numpy as np
import pytest

from pymilvus.milvus_client import MilvusClient


@pytest.mark.skipif(sys.platform.startswith('win'), reason="Milvus Lite is not supported on Windows")
class TestMilvusLite:

def test_milvus_lite(self):
with TemporaryDirectory(dir='./') as root:
db_file = os.path.join(root, 'test.db')
Expand Down

0 comments on commit 6f84c2c

Please sign in to comment.