-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amend test suite for compatibility with libmamba v2 #13784
base: main
Are you sure you want to change the base?
Changes from all commits
1bbf1d1
4c24113
d845e3c
a6069ef
952648b
befa2e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# SPDX-License-Identifier: BSD-3-Clause | ||
import copy | ||
import os | ||
import re | ||
import sys | ||
from pprint import pprint | ||
from unittest.mock import Mock, patch | ||
|
@@ -2692,6 +2693,14 @@ def test_timestamps_1(tmpdir): | |
|
||
|
||
def test_channel_priority_churn_minimized(tmpdir): | ||
""" | ||
get_solver_aggregate_2 has [channel-4, channel-2]. | ||
When the channels are reverted in the second operation, we put | ||
channel-2 first. Under these circumstances, reinstalling | ||
'itsdangerous' should pick the noarch version from channel-2 | ||
instead of the non-noarch variant in channel-4. Everything | ||
else should stay the same due to FREEZE_INSTALLED. | ||
""" | ||
specs = ( | ||
MatchSpec("conda-build"), | ||
MatchSpec("itsdangerous"), | ||
|
@@ -2701,6 +2710,12 @@ def test_channel_priority_churn_minimized(tmpdir): | |
|
||
pprint(convert_to_dist_str(final_state)) | ||
|
||
if context.solver == "libmamba": | ||
# With libmamba v2, we need this extra flag to make this test pass | ||
# Otherwise, the solver considers the current state as satisfying. | ||
solver_kwargs = {"force_reinstall": True} | ||
else: | ||
solver_kwargs = {} | ||
with get_solver_aggregate_2( | ||
tmpdir, | ||
[MatchSpec("itsdangerous")], | ||
|
@@ -2709,7 +2724,8 @@ def test_channel_priority_churn_minimized(tmpdir): | |
) as solver: | ||
solver.channels.reverse() | ||
unlink_dists, link_dists = solver.solve_for_diff( | ||
update_modifier=UpdateModifier.FREEZE_INSTALLED | ||
update_modifier=UpdateModifier.FREEZE_INSTALLED, | ||
**solver_kwargs, | ||
) | ||
pprint(convert_to_dist_str(unlink_dists)) | ||
pprint(convert_to_dist_str(link_dists)) | ||
|
@@ -3076,9 +3092,7 @@ def test_freeze_deps_1(tmpdir): | |
( | ||
"channel-2::six-1.7.3-py34_0", | ||
"channel-2::python-3.4.5-0", | ||
# LIBMAMBA ADJUSTMENT | ||
# libmamba doesn't remove xz in this solve | ||
*(() if context.solver == "libmamba" else ("channel-2::xz-5.2.3-0",)), | ||
"channel-2::xz-5.2.3-0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. v2 fixed this solver difference. We can still bring it back with this change, though. |
||
) | ||
) | ||
link_order = add_subdir_to_iter( | ||
|
@@ -3282,12 +3296,12 @@ def test_downgrade_python_prevented_with_sane_message(tmpdir): | |
error_snippets = [ | ||
"Encountered problems while solving", | ||
"Pins seem to be involved in the conflict. Currently pinned specs", | ||
"python 2.6.*", | ||
"scikit-learn 0.13", | ||
r"python.*2\.6", | ||
r"scikit-learn.*0\.13", | ||
] | ||
|
||
for snippet in error_snippets: | ||
assert snippet in error_msg | ||
assert re.search(snippet, error_msg) | ||
|
||
specs_to_add = (MatchSpec("unsatisfiable-with-py26"),) | ||
with get_solver( | ||
|
@@ -3310,12 +3324,12 @@ def test_downgrade_python_prevented_with_sane_message(tmpdir): | |
error_snippets = [ | ||
"Encountered problems while solving", | ||
"Pins seem to be involved in the conflict. Currently pinned specs", | ||
"python 2.6.*", | ||
r"python.*2\.6", | ||
"unsatisfiable-with-py26", | ||
] | ||
|
||
for snippet in error_snippets: | ||
assert snippet in error_msg | ||
assert re.search(snippet, error_msg) | ||
|
||
|
||
fake_index = [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ def bash_unsupported() -> str | None: | |
|
||
|
||
skip_unsupported_bash = pytest.mark.skipif( | ||
bash_unsupported(), | ||
bool(bash_unsupported()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a recent pytest release got stricter about the types here. |
||
reason=bash_unsupported() or "bash: supported!", | ||
) | ||
skip_unsupported_posix_path = pytest.mark.skipif( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.