Skip to content
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

uv python plugin #706

Closed
lengau opened this issue Apr 15, 2024 · 4 comments · Fixed by #930
Closed

uv python plugin #706

lengau opened this issue Apr 15, 2024 · 4 comments · Fixed by #930
Labels
Enhancement New feature or request

Comments

@lengau
Copy link
Contributor

lengau commented Apr 15, 2024

What needs to get done

Either a separate plugin or an opt-in configuration option for the Python plugin to use uv instead of standard venv and pip.

Why it needs to get done

We should provide first-class support for multiple Python build systems

@lengau lengau added the Enhancement New feature or request label Apr 15, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2810.

This message was autogenerated

@tigarmo
Copy link
Contributor

tigarmo commented Dec 2, 2024

We currently have two draft PRs for this:

@lengau any thoughts on which approach we should follow?

@lengau
Copy link
Contributor Author

lengau commented Dec 2, 2024

@tigarmo I think we need both, though in different ways.

  1. The uv plugin should set UV_PROJECT_ENVIRONMENT={self.get_venv_directory()} and UV_FROZEN=1 and then use uv sync to set up the venv (or something similar)
  2. We should have an option in the plain python plugin to use uv venv and uv pip rather than the system's venv and pip. This could also be something like offering a configuration to set the venv and pip commands.

This request is just for the first though.

@lengau
Copy link
Contributor Author

lengau commented Dec 2, 2024

Per conversation:

  • Set UV_PYTHON to $PARTS_PYTHON_INTERPRETER so we're using the system Python (during the build steps, only if not already set)
  • Set UV_PYTHON_PREFERENCE=only-system in the build environment.

@bepri bepri mentioned this issue Dec 10, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants