Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

Commit 54e4c82

Browse files
authored
feat: upgrade to py-rattler 0.21.0 (#92)
* prod: see if latest py-rattler works * feat: upgrade to py-rattler 0.21 * test: update tests for outdated ref * Apply suggestion from @beckermr * Apply suggestion from @beckermr
1 parent 3ea5be6 commit 54e4c82

File tree

7 files changed

+49
-22
lines changed

7 files changed

+49
-22
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
rev: v0.14.10
2727
hooks:
2828
# Run the linter.
29-
- id: ruff
29+
- id: ruff-check
3030
args: [ --fix ]
3131
# Run the formatter.
3232
- id: ruff-format

conda_forge_feedstock_check_solvable/check_solvable.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ def _is_recipe_solvable_on_platform(
353353
)
354354
timeout_timer.raise_for_timeout()
355355

356+
print_debug("build run exports::\n\n%s\n" % pprint.pformat(build_rx))
357+
356358
solvable = solvable and _solvable
357359
if _err is not None:
358360
errors.append(_err)
@@ -394,6 +396,8 @@ def _is_recipe_solvable_on_platform(
394396
)
395397
timeout_timer.raise_for_timeout()
396398

399+
print_debug("host run exports::\n\n%s\n" % pprint.pformat(host_rx))
400+
397401
solvable = solvable and _solvable
398402
if _err is not None:
399403
errors.append(_err)

conda_forge_feedstock_check_solvable/rattler_build.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
import atexit
12
import os
23
import subprocess
34
import tempfile
45
import uuid
56

67
import yaml
78

8-
from conda_forge_feedstock_check_solvable.utils import print_debug
9+
from conda_forge_feedstock_check_solvable.utils import clean_rattler_cache, print_debug
910
from conda_forge_feedstock_check_solvable.virtual_packages import (
1011
virtual_package_repodata,
1112
)
1213

14+
atexit.register(clean_rattler_cache)
15+
1316

1417
def run_rattler_build(command):
1518
try:
@@ -27,20 +30,6 @@ def run_rattler_build(command):
2730
return status_code, stdout, stderr
2831
except Exception as e:
2932
return -1, "", str(e)
30-
finally:
31-
try:
32-
subprocess.run(
33-
[
34-
"pixi",
35-
"clean",
36-
"cache",
37-
"--yes",
38-
],
39-
check=False,
40-
capture_output=True,
41-
)
42-
except Exception as e:
43-
print_debug("pixi clean cache command failed: %r", e)
4433

4534

4635
def invoke_rattler_build(

conda_forge_feedstock_check_solvable/rattler_solver.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import atexit
23
import copy
34
import datetime
45
import os
@@ -11,12 +12,15 @@
1112

1213
from conda_forge_feedstock_check_solvable.utils import (
1314
DEFAULT_RUN_EXPORTS,
15+
clean_rattler_cache,
1416
convert_spec_to_conda_build,
1517
get_run_exports,
1618
print_debug,
1719
print_warning,
1820
)
1921

22+
atexit.register(clean_rattler_cache)
23+
2024

2125
class RattlerSolver:
2226
"""Run the rattler solver (resolvo).
@@ -171,7 +175,7 @@ def _get_run_exports(
171175
We only look up export data for things explicitly listed in the original
172176
specs.
173177
"""
174-
names = {s.name for s in _specs}
178+
names = {s.name.as_package_name() for s in _specs}
175179
ign_rex_from = {s.name for s in ignore_run_exports_from}
176180
ign_rex = {s.name for s in ignore_run_exports}
177181
run_exports = copy.deepcopy(DEFAULT_RUN_EXPORTS)

conda_forge_feedstock_check_solvable/utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,3 +697,16 @@ def replace_pin_compatible(reqs, host_reqs, strict=False):
697697
new_reqs.append(req)
698698

699699
return new_reqs
700+
701+
702+
def clean_rattler_cache():
703+
subprocess.run(
704+
[
705+
"pixi",
706+
"clean",
707+
"cache",
708+
"--yes",
709+
],
710+
check=False,
711+
capture_output=True,
712+
)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ wurlitzer
1111
requests
1212
zstandard
1313
boltons>=23.0.0
14-
py-rattler>=0.9.0,<0.10a0
14+
py-rattler>=0.21.0,<0.22a0
1515
pixi

tests/test_check_solvable.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_r_base_cross_solvable(solver):
161161
def test_xgboost_solvable(tmp_path, solver):
162162
feedstock_dir = clone_and_checkout_repo(
163163
tmp_path,
164-
"https://github.com/conda-forge/arrow-cpp-feedstock",
164+
"https://github.com/conda-forge/xgboost-feedstock",
165165
ref="main",
166166
)
167167

@@ -303,9 +303,9 @@ def test_dftbplus_solvable(tmp_path, solver):
303303
assert solvable, pprint.pformat(errors)
304304

305305

306-
@flaky
307-
def test_cupy_solvable(tmp_path, solver):
308-
"""grpcio has a runtime dep on openssl which has strange pinning things in it"""
306+
@pytest.mark.xfail
307+
def test_cupy_solvable_at_commit(tmp_path, solver):
308+
"""cupy at a specific commit - old test so fails"""
309309
feedstock_dir = clone_and_checkout_repo(
310310
tmp_path,
311311
"https://github.com/conda-forge/cupy-feedstock",
@@ -327,6 +327,23 @@ def test_cupy_solvable(tmp_path, solver):
327327
assert solvable, pprint.pformat(errors)
328328

329329

330+
def test_cupy_solvable(tmp_path, solver):
331+
feedstock_dir = clone_and_checkout_repo(
332+
tmp_path,
333+
"https://github.com/conda-forge/cupy-feedstock",
334+
ref="main",
335+
)
336+
solvable, errors, solvable_by_variant = is_recipe_solvable(
337+
feedstock_dir,
338+
solver=solver,
339+
verbosity=VERB,
340+
timeout=None,
341+
fail_fast=True,
342+
)
343+
pprint.pprint(solvable_by_variant)
344+
assert solvable, pprint.pformat(errors)
345+
346+
330347
@flaky
331348
def test_run_exports_constrains_conflict(feedstock_dir, tmp_path_factory, solver):
332349
recipe_file = os.path.join(feedstock_dir, "recipe", "meta.yaml")

0 commit comments

Comments
 (0)