Skip to content

Commit

Permalink
feat: Disable installation of milvus-lite on windows platform (#2137)
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

---------

Signed-off-by: yangxuan <[email protected]>
Co-authored-by: Rui Zhang <[email protected]>
Co-authored-by: rui zhang <[email protected]>
  • Loading branch information
3 people authored Jun 17, 2024
1 parent c9f87bc commit 23847a6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies=[
"ujson>=2.0.0",
"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 23847a6

Please sign in to comment.