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

Experimental: support for uv #154

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Experimental: support for uv #154

wants to merge 1 commit into from

Conversation

antirotor
Copy link
Member

Changelog Description

uv is an extremely fast Python package installer and resolver, written in Rust, and designed as a drop-in replacement for pip and pip-tools workflows. This PR is trying experimentaly use uv instead of Poetry to handle dependencies.

Additional info

Thanks to it's speed, we could use it to dynamically build environments for every process we run (ie. when running DCC with different Python, to avoid python dependency conflicts with main process).

Note

This is just an experiment - to see how uv can be utilized and if it provides something more than Poetry already does. It has it's own caveats - lock files are platform specific for example, and so on.

Testing:

running manage.ps1 should utilize uv already - note linux version isn't done yet.

@antirotor antirotor self-assigned this Aug 20, 2024
@antirotor antirotor added the type: feature Adding something new and exciting to the product label Aug 20, 2024
@antirotor antirotor requested a review from iLLiCiTiT August 20, 2024 16:29
@tweak-wtf
Copy link

tweak-wtf commented Sep 19, 2024

i just checked this out and fiddled around a bit to get it running on my windows box. naively running ./tools/manage.ps1 create-env until it was working. had uv installed already the same way as in manage.ps1.

here's the changes: feature/use-uv...tweak-wtf:ayon-launcher:feature/use-uv-playground

it was picking up my system python so i added a python flag in uv venv that would restrict to 3.9.
then it was failing for not finding .venv/Scripts/pre-commit as it somehow didn't got installed from the compiled requirements.txt. so adding it to windows-requirements.txt did the trick.

i do get version warnings when running the tray because i think it's checking my system python but seems cosmetic. anyways, with cached dependencies the install takes 3s for me rn😅

EDIT: i realized the .python-version file only in the end. i think this would be better than adding the python flag to uv venv

@antirotor
Copy link
Member Author

EDIT: i realized the .python-version file only in the end. i think this would be better than adding the python flag to uv venv

Ah, I've never get into that issue because I am always running pyenv so there's always .python-version. Maybe the next step would be to change https://github.com/ynput/ayon-dependencies-tool to make use of uv. I am wondering what speed gains could we find there.

@antirotor
Copy link
Member Author

So there is another use case perfect for uv - we can solve some of the issues like this one or in general all cases where we now install pyside2/6 and otio to running python environment. To support offline studios, we need to distribute "cached" pip index with AYON somehow and build venv using uv on the fly. Problem with uv and it's caching is (if I understand it correctly) that uv is not caching wheels themselves, but unzipped content and there is no "populate cache" functionality currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Adding something new and exciting to the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants