Skip to content

Add Rattler based installer backend#171

Draft
jaimergp wants to merge 7 commits into
mainfrom
rattler
Draft

Add Rattler based installer backend#171
jaimergp wants to merge 7 commits into
mainfrom
rattler

Conversation

@jaimergp
Copy link
Copy Markdown
Member

@jaimergp jaimergp commented Aug 9, 2025

Closes #157

For now I'm using a subprocess to not disrupt the whole QProcess machinery, but we could totally do this in-process if we wanted.

@psobolewskiPhD
Copy link
Copy Markdown
Member

Any thought to releasing the rattler CI as its own thing? I mean it seems useful more broadly?

@jaimergp
Copy link
Copy Markdown
Member Author

I started it as a private detail because I don't want external folks using it on their own and start suggesting an expansion of scope that increases our maintenance burden in the long run.

@jaimergp
Copy link
Copy Markdown
Member Author

During the community call yesterday, Tim floated the idea of just having a declarative file with the requested plugins, and whether they come from conda or PyPI. I think it makes a lot of sense and simplifies our setup. I can work on this PR so it's not as imperative, buuut...

The only con I can think of is that any changes done to the environment will be lost if not collected in the declarative file, which might annoy power users.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 30, 2025

Codecov Report

❌ Patch coverage is 76.12903% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.48%. Comparing base (c6c473c) to head (2d91171).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
src/napari_plugin_manager/_rattler_installer.py 79.76% 17 Missing ⚠️
...napari_plugin_manager/base_qt_package_installer.py 70.00% 15 Missing ⚠️
src/napari_plugin_manager/qt_package_installer.py 37.50% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
- Coverage   94.48%   93.48%   -1.01%     
==========================================
  Files          14       15       +1     
  Lines        2159     2303     +144     
==========================================
+ Hits         2040     2153     +113     
- Misses        119      150      +31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dalthviz
Copy link
Copy Markdown
Member

Hi there, gave this a check and seems like this is missing the GUI part so users can select the rattler backend, right? Maybe adding an option in the tool/source combobox for rattler is missing or maybe it could be that rattler will eventually replace the direct usage of conda?

Tried giving this a check locally by making the conda option in the GUI to select the rattler tool value but seems like that is not enough to make the backend work. When trying to install a package I got the following output/error:

Starting 'C:\Users\dalth\anaconda3\envs\napari-plugin-manager-dev\python.exe' with args ['-m', 'napari_plugin_manager._rattler_installer', '--action', 'install', '--prefix', 'C:\\Users\\dalth\\anaconda3\\envs\\napari-plugin-manager-dev', '--channel', 'conda-forge', 'affinder==0.5.0']
Traceback (most recent call last):
  File "C:\Users\dalth\anaconda3\envs\napari-plugin-manager-dev\lib\runpy.py", line 196, in _run_module_as_main

    return _run_code(code, main_globals, None,
  File "C:\Users\dalth\anaconda3\envs\napari-plugin-manager-dev\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "E:\Acer\Documentos\Quansight\Napari\napari-plugin-manager\src\napari_plugin_manager\_rattler_installer.py", line 196, in <module>
    sys.exit(asyncio.run(main()))
  File "C:\Users\dalth\anaconda3\envs\napari-plugin-manager-dev\lib\asyncio\runners.py", line 44, in run

    return loop.run_until_complete(main)
  File "C:\Users\dalth\anaconda3\envs\napari-plugin-manager-dev\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "E:\Acer\Documentos\Quansight\Napari\napari-plugin-manager\src\napari_plugin_manager\_rattler_installer.py", line 152, in main
    records, requested = await solve_records(
  File "E:\Acer\Documentos\Quansight\Napari\napari-plugin-manager\src\napari_plugin_manager\_rattler_installer.py", line 115, in solve_records
    return await rattler.solve(
  File "C:\Users\dalth\anaconda3\envs\napari-plugin-manager-dev\lib\site-packages\rattler\solver\solver.py", line 85, in solve
    for solved_package in await py_solve(
exceptions.SolverException: Cannot solve the request because of: No candidates were found for none *.


Task finished with exit code 1 with status 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Replace conda subprocesses with py-rattler logic

3 participants