Skip to content

Conversation

@probably-not
Copy link
Contributor

@probably-not probably-not commented Aug 7, 2025

In the current Pythonx code, the uv package manager's version is hard-coded to a very old version. The uv version not only controls the version of the package manager, but also the managed Python installations which can be used with uv. Since Pythonx enforces using only managed Python versions, this makes it impossible to use versions that have been added in later versions of the uv package manager.

This PR enables the user to set options like which uv version to download, enabling users to change the version based on their needs, and allowing new versions to be downloaded on demand. This is aligned with other packages which pull CLIs from releases like the esbuild and tailwind packages, which enable the user to set the configured version in their config.exs.

In addition to the configuration, I've also updated the default uv version to the latest version as of this date.

README.md Outdated

The `opts` parameter currently accepts 2 options:
* `:force` - if true, runs with empty project cache. Defaults to `false`.
* `:uv_version` - select the version of the uv package manager to use. Defaults to `Pythonx.Uv.default_uv_version()`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same thing here - I wasn't sure if I should reference this or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we want to nest it under opts? Perhaps just uv_version: ... directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Either way works! I was going more in the direction of being able to just send the opts value directly to the functions. If we just use uv_version:... and force:... directly I think I probably just need to change the application.ex to pop the pyproject_toml value from the config and then pass the rest of the config down into the Uv module?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's how i'd do it but let's wait for @jonatanklosko's opinion.

Copy link
Member

Choose a reason for hiding this comment

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

I definitely prefer it not nested. I also don't think we need :force as a global option, or at least I would wait for a use case and then evaluate other solutions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, will update so that only the uv_version can be set 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated so that it's explicitly only allowing the uv_version as an option from the compile envs - let me know if this works or if there are any more changes needed here

Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Thank you :)

@jonatanklosko jonatanklosko merged commit d194440 into livebook-dev:main Aug 8, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants