Skip to content

fix(deps): install the milvus-lite extra on Windows for Python >=3.10 (#3676) - #3767

Open
Anai-Guo wants to merge 2 commits into
milvus-io:masterfrom
Anai-Guo:fix-milvus-lite-win32-extra
Open

fix(deps): install the milvus-lite extra on Windows for Python >=3.10 (#3676)#3767
Anai-Guo wants to merge 2 commits into
milvus-io:masterfrom
Anai-Guo:fix-milvus-lite-win32-extra

Conversation

@Anai-Guo

Copy link
Copy Markdown

Summary

Fixes #3676.

pip install -U "pymilvus[milvus-lite]" installs nothing on Windows, silently. The extra carries a sys_platform!='win32' marker:

milvus_lite = [
    "milvus-lite>=2.4.0;sys_platform!='win32'",
    ...
]

so the resolver drops the requirement, exits 0, and the user gets a pymilvus with no local mode — even though the README and docs list Windows as supported. There is no warning, because an extra whose markers all evaluate false is not an error.

Why the marker was right, and why it no longer is

It was correct when written. milvus-lite <3.0 published platform-specific wheels only:

milvus_lite-2.5.1-py3-none-macosx_10_9_x86_64.whl
milvus_lite-2.5.1-py3-none-macosx_11_0_arm64.whl
milvus_lite-2.5.1-py3-none-manylinux2014_aarch64.whl
milvus_lite-2.5.1-py3-none-manylinux2014_x86_64.whl

No Windows wheel existed, so excluding win32 was the only way to keep the extra resolvable.

Since 3.0 the project ships a single pure-Python wheel:

milvus_lite-3.2.0-py3-none-any.whl

py3-none-any installs on Windows. The exclusion is now stale.

Why a new marker instead of relaxing the existing one

milvus-lite 3.x declares requires_python >=3.10, while pymilvus still supports 3.9 (requires-python = '>=3.9'). Simply dropping !='win32' would let the resolver try to satisfy milvus-lite>=2.4.0 on Windows + Python 3.9, where no wheel exists for that platform.

Adding a separate win32 branch pinned to >=3.0 keeps each environment pointed at a distribution that actually exists:

platform Python resolved
win32 3.9 (nothing — correct, no candidate exists)
win32 3.10 milvus-lite>=3.0
win32 3.12 milvus-lite>=3.0
linux 3.9 milvus-lite>=2.4.0 (unchanged)
linux 3.12 milvus-lite>=2.4.0 (unchanged)
darwin 3.12 milvus-lite>=2.4.0 (unchanged)

Generated by evaluating the three requirement markers with packaging.markers.Marker(...).evaluate(env). Non-Windows resolution is byte-for-byte unchanged.

Verification

Milvus Lite was exercised end-to-end on Windows 11 (Python 3.12.10, clean venv), not just installed:

from pymilvus import MilvusClient
c = MilvusClient("wintest.db")
c.create_collection(collection_name="demo", dimension=4)
c.insert(collection_name="demo", data=[
    {"id": 1, "vector": [0.1, 0.2, 0.3, 0.4], "text": "hello"},
    {"id": 2, "vector": [0.9, 0.8, 0.7, 0.6], "text": "windows"},
])
print(c.search(collection_name="demo", data=[[0.1, 0.2, 0.3, 0.4]],
               limit=2, output_fields=["text"]))
milvus-lite 3.2.0
data: [[{'id': 1, 'distance': 1.0, 'entity': {'id': 1, 'text': 'hello'}},
        {'id': 2, 'distance': 0.8427009582519531, 'entity': {'id': 2, 'text': 'windows'}}]]
db file created: True

Collection creation, insert, and vector search all succeed, and the .db file is written.

Notes

This supersedes #3701, which proposed the same version-aware split and was closed by its author on 2026-08-12 without maintainer objection. I kept the >=3.10 gate for the reason given above and left the existing setuptools<82 pin untouched.

🤖 Generated with Claude Code

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Anai-Guo
To complete the pull request process, please assign longjiquan after the PR has been reviewed.
You can assign the PR to them by writing /assign @longjiquan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify mergify Bot added the needs-dco label Aug 22, 2026
@Anai-Guo
Anai-Guo force-pushed the fix-milvus-lite-win32-extra branch from bb5cc7b to 351fc4b Compare August 22, 2026 01:28
The milvus_lite extra carries a `sys_platform!='win32'` marker, so
`pip install -U "pymilvus[milvus-lite]"` silently installs nothing on
Windows even though the docs and README list Windows as supported.

That marker was correct when it was written: milvus-lite <3.0 only
published macOS and manylinux wheels. Since 3.0 the project ships a
single pure-Python `py3-none-any` wheel, which installs and runs on
Windows. Add a win32 branch pinned to >=3.0 rather than relaxing the
existing marker, because milvus-lite 3.x requires Python >=3.10 while
pymilvus still supports 3.9 -- on Windows + 3.9 there is still no
installable candidate, and the resolver should say so instead of
picking a 2.x wheel that does not exist for that platform.

Non-Windows resolution is unchanged.

Fixes milvus-io#3676

Signed-off-by: Anai-Guo <antai12232931@outlook.com>
@Anai-Guo
Anai-Guo force-pushed the fix-milvus-lite-win32-extra branch from 351fc4b to 4d6838b Compare August 22, 2026 01:29
@mergify mergify Bot added dco-passed and removed needs-dco labels Aug 22, 2026
@mergify

mergify Bot commented Aug 22, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Comment thread pyproject.toml
# milvus-lite <3.0 only published macOS/manylinux wheels, hence the win32 exclusion
# above. 3.x ships a pure-Python py3-none-any wheel that works on Windows, but it
# requires Python >=3.10, so 3.9 on Windows still has no installable candidate.
"milvus-lite>=3.0;sys_platform=='win32' and python_version>='3.10'",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyproject.toml line:84
Medium ---- This new win32 branch is not reflected in the committed uv.lock. At the PR head the lock still records the milvus_lite extra as milvus-lite>=2.4.0; sys_platform != 'win32' and extra == 'milvus-lite' (uv.lock requires-dist, ~line 3559) and keeps milvus-lite 3.0's resolution markers win32-excluded for Python 3.11-3.14 (uv.lock ~lines 2114-2124). Both CI workflows run uv sync --frozen, which uses the lockfile as the source of truth and does not check freshness, so the Windows branch of this extra will never be installed in the repo's own environments, and any uv lock / uv sync --locked run will report drift. The superseded PR #3701 regenerated uv.lock (adding the faiss-cpu win_amd64 wheel) when it changed this extra, and CONTRIBUTING.md documents uv.lock as the locked dependency graph used by uv. Please run uv lock and commit the updated lockfile in this PR.

Comment thread pyproject.toml
# milvus-lite <3.0 only published macOS/manylinux wheels, hence the win32 exclusion
# above. 3.x ships a pure-Python py3-none-any wheel that works on Windows, but it
# requires Python >=3.10, so 3.9 on Windows still has no installable candidate.
"milvus-lite>=3.0;sys_platform=='win32' and python_version>='3.10'",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyproject.toml line:84
Medium ---- tests/integration/lite/test_milvus_lite.py (unchanged by this PR) still hard-skips the whole module on Windows: pytestmark = pytest.mark.skipif(sys.platform.startswith("win"), reason="Milvus Lite is not supported on Windows"). That marker now directly contradicts the behavior this PR enables, so the fix is never exercised by the repo's own CI (the windows-2022 matrix collects then skips the Lite tests), and a future reader trusting the marker will keep believing Windows is unsupported. The issue discussion (#3676) explicitly proposed enabling these tests on a supported Windows/Python combination, and the superseded PR #3701 de-skipped the same file. Please re-gate the skip on python_version < '3.10' instead of the platform (milvus-lite 3.x requires Python >=3.10), and consider adding a CI step that installs .[milvus-lite] on Windows so this metadata fix is actually verified.

…dows

Signed-off-by: Anai-Guo <antai12232931@outlook.com>
@Anai-Guo

Copy link
Copy Markdown
Author

Thanks @yhmo — both points were correct and are fixed in 1d83032.

1. uv.lock was stale. Regenerated with uv lock (uv 0.9.x). The diff is +117/-65 and contains zero package version changes — it is entirely the mechanical consequence of the new marker: the python_full_version == '3.10.*' resolution marker splits into … and sys_platform != 'win32' / … == 'win32', and faiss-cpu gains its already-published win_amd64 / win_arm64 wheel entries. The two lines that matter now read:

{ name = "milvus-lite", marker = "python_full_version >= '3.10' and sys_platform == 'win32' and extra == 'milvus-lite'", specifier = ">=3.0" },
{ name = "milvus-lite", marker = "sys_platform != 'win32' and extra == 'milvus-lite'", specifier = ">=2.4.0" },

2. The module-level Windows skip contradicted the fix. Dropped the pytestmark = pytest.mark.skipif(sys.platform.startswith("win"), …) and the if not sys.platform.startswith("win") guard around it, leaving the plain pytest.importorskip("milvus_lite", …) to decide. That keeps Windows + Python 3.9 skipping (no installable candidate, as the pyproject comment explains) while letting 3.10+ actually run. import sys is now unused and removed.

Verified on real Windows, not by reasoning — this machine is Windows 11 / windows-2022-class:

$ uv run --group dev --extra milvus-lite python -c "import milvus_lite, platform, sys; print(...)"
milvus_lite 3.0 py 3.11.15 Windows

$ PYTHONPATH=. uv run --group dev --extra milvus-lite pytest tests/integration/lite -v
tests/integration/lite/test_milvus_lite.py::TestMilvusLite::test_milvus_client_with_local_db_path PASSED [ 25%]
tests/integration/lite/test_milvus_lite.py::TestMilvusLite::test_milvus_lite_insert_search        PASSED [ 50%]
tests/integration/lite/test_milvus_lite.py::TestMilvusLite::test_milvus_lite_multiple_clients_same_db PASSED [ 75%]
tests/integration/lite/test_milvus_lite.py::TestMilvusLite::test_illegal_name                     PASSED [100%]
============================== 4 passed in 4.48s ==============================

So the Lite server does start, serve, and answer on Windows under milvus-lite 3.0 — the four tests that CI has been collecting-then-skipping on the windows-2022 matrix leg now genuinely exercise the path this PR enables.

(The AllocTimestamp … Method not implemented! lines in the log are pre-existing and unrelated — milvus-lite does not implement that RPC and the client falls back; the same lines appear on Linux.)

🤖 Generated with Claude Code

@mergify mergify Bot added needs-dco and removed dco-passed labels Aug 29, 2026
@Anai-Guo
Anai-Guo force-pushed the fix-milvus-lite-win32-extra branch 2 times, most recently from 4cac705 to ab92b32 Compare August 31, 2026 10:25
@mergify mergify Bot added dco-passed and removed needs-dco labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows: pymilvus[milvus-lite] does not install milvus-lite despite Windows support

3 participants