From 83aeba546226b714b30091827dd6c30f8795ac59 Mon Sep 17 00:00:00 2001 From: sophia Date: Thu, 21 May 2026 16:09:11 -0700 Subject: [PATCH 1/2] Check for windows specific site-packages path --- tests/test_repoquery.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_repoquery.py b/tests/test_repoquery.py index daa32470..f5e35732 100644 --- a/tests/test_repoquery.py +++ b/tests/test_repoquery.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: BSD-3-Clause import json +from conda.common.compat import on_win from conda.models.channel import Channel from conda_libmamba_solver.index import LibMambaIndexHelper @@ -58,6 +59,14 @@ def test_query_search_includes_python_site_packages_path(): assert prec.name == "python" assert prec.version == "3.13.2" if python_site_packages_path_support: - assert prec.python_site_packages_path == "lib/python3.13t/site-packages" + # python_site_packages_path is computed by mamba for every python package. + # ref: https://github.com/mamba-org/mamba/blob/2.6.2/libmamba/src/core/query.cpp#L237-L245 + # Windows vs unix and free-threaded vs not free-threaded will have different results. + # ref: https://github.com/mamba-org/mamba/pull/4268/changes + # issue ref: https://github.com/mamba-org/mamba/issues/4286 + if on_win: + assert prec.python_site_packages_path == "Lib/site-packages" + else: + assert prec.python_site_packages_path == "lib/python3.13t/site-packages" else: assert prec.python_site_packages_path is None From 774273b7d29ebc0809e43870d2fc5b8041cecb1a Mon Sep 17 00:00:00 2001 From: sophia Date: Fri, 22 May 2026 11:26:19 -0700 Subject: [PATCH 2/2] xfail repoquery for python packages tests on windows --- tests/test_repoquery.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/test_repoquery.py b/tests/test_repoquery.py index f5e35732..d124de00 100644 --- a/tests/test_repoquery.py +++ b/tests/test_repoquery.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: BSD-3-Clause import json +import pytest from conda.common.compat import on_win from conda.models.channel import Channel @@ -51,6 +52,7 @@ def test_query_search(): ) +@pytest.mark.xfail(on_win, reason="libmambapy bug https://github.com/mamba-org/mamba/issues/4286") def test_query_search_includes_python_site_packages_path(): index = LibMambaIndexHelper(channels=[Channel("conda-forge")], subdirs=("linux-64", "noarch")) results = index.search("python=3.13.2=h4724d56_1_cp313t") @@ -59,14 +61,6 @@ def test_query_search_includes_python_site_packages_path(): assert prec.name == "python" assert prec.version == "3.13.2" if python_site_packages_path_support: - # python_site_packages_path is computed by mamba for every python package. - # ref: https://github.com/mamba-org/mamba/blob/2.6.2/libmamba/src/core/query.cpp#L237-L245 - # Windows vs unix and free-threaded vs not free-threaded will have different results. - # ref: https://github.com/mamba-org/mamba/pull/4268/changes - # issue ref: https://github.com/mamba-org/mamba/issues/4286 - if on_win: - assert prec.python_site_packages_path == "Lib/site-packages" - else: - assert prec.python_site_packages_path == "lib/python3.13t/site-packages" + assert prec.python_site_packages_path == "lib/python3.13t/site-packages" else: assert prec.python_site_packages_path is None