Skip to content

Reckless uv installer #8430

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

Merged
merged 7 commits into from
Aug 11, 2025
Merged

Conversation

endothermicdev
Copy link
Collaborator

@endothermicdev endothermicdev commented Jul 28, 2025

Important

25.09 FREEZE July 28TH: Non-bugfix PRs not ready by this date will wait for 25.12.

RC1 is scheduled on August 11th

The final release is scheduled for September 1st.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.

This PR allows reckless to use the uv python package manager when installing plugins. It maintains the same virtual environment location and source code location as used by the pip and poetry installers. There's also a driveby fix of an obscure direct install bug.

@endothermicdev endothermicdev added this to the v25.09 milestone Jul 28, 2025
@@ -983,6 +986,37 @@ def cargo_installation(cloned_plugin: InstInfo):
return cloned_plugin


def install_python_uv(cloned_plugin: InstInfo):
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just replace pip installation with uv as it supports all its capabilities

Copy link
Collaborator

Choose a reason for hiding this comment

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

why not just replace pip installation with uv as it supports all its capabilities

What if user doesn't have uv but has pip/poetry?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the general upgrade path is:

  1. Add the ability to install with uv.
  2. Switch python plugins over to a uv package management (this will break those plugins for existing users until they upgade to CLN/reckless 25.09
  3. Remove the legacy installers from reckless if no longer needed.

We generally try to support the last three releases, so encouraging all python plugins to switch to uv now would impact users of prior CLN versions. Unless we have a reliable way translate pip package requirements into a uv lockfile and do dependency resolution, I think we should keep the legacy installers around for a healthy amount of overlap as plugins make the transition.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense yeah I got the answer myself after pondering on it just didn't get to reply. We should definitely keep pip but remove poetry in the later releases probably as giving people too many options to do a single thing doesn't seem like a good idea.

If we can just pivot on uv as primary python plugin management tool that would be great.

@madelinevibes madelinevibes added Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. PLEASE clear CI 🫠 labels Aug 6, 2025
@ShahanaFarooqui ShahanaFarooqui self-requested a review August 6, 2025 20:31
Copy link
Collaborator

@ShahanaFarooqui ShahanaFarooqui left a comment

Choose a reason for hiding this comment

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

  • I wanted to test the plugin with a real-world UV-managed Python plugin but couldn’t find any suitable example. Do you have any recommendation for a known project that uses UV for plugin management?

  • Additionally, would it make sense to add a test case for installing a test plugin via uv installer as well?

Comment on lines +1001 to +1002
(Path(cloned_plugin.source_loc) / 'pyproject.toml').\
symlink_to(source / 'pyproject.toml')
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add support for requirements.txt using uv too?

Some installer procedures have more options for valid entypoint
names than others. We iterate through each of their first choices,
then their second choices, etc..
uv is a python installation and package manager written in
rust.  We can use it to quickly install python package
dependencies and configure our plugin's python virtual environment.
To maintain consistency with our other reckless python
installations, the venv is still activated in a wrapper which then
imports the original python source.

Changelog-added: reckless can now install python plugins using the uv package manager.
Those that only have a requirements.txt can be installed
with uv even if it's not managing the project requirements.
@endothermicdev
Copy link
Collaborator Author

Added a uv managed test project and blackbox test. Also added a two-step uv bare virtual env creation + uv installation via requirements.txt to that venv. I hadn't realized you could do that - thanks for the tip @king-11! Unfortunately it now overrides the normal test_reckless.py::test_install pytest case because it prefers to use uv where possible, but maybe that's not so bad as we're trying to move away from pip & poetry.

@ShahanaFarooqui ShahanaFarooqui self-requested a review August 11, 2025 22:55
Copy link
Collaborator

@ShahanaFarooqui ShahanaFarooqui left a comment

Choose a reason for hiding this comment

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

ACK 705c5e4.

@madelinevibes madelinevibes merged commit ebbe5a2 into ElementsProject:master Aug 11, 2025
75 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status::Ready for Review The work has been completed and is now awaiting evaluation or approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants