chore: use uv to manage venv - #149
Conversation
|
Thanks for the upgrade! It may be good for us to have a short intro to uv workflows, either written or orally. If you write it down, I think REMIND-MFA is the best place rather than flodym. I'm sure, there's also existing tutorials online? Should just be short and limited to the bits we need regularly. As for the editable flodym: It has eased our workflow in the past to have it editable by default, and we were the only REMIND-MFA users. I see, of course, that this changes soon, so it's only a matter of time until we have to change it. So I'm also okay with doing it now. |
I searched a bit online, and was surprised that I couldn't find a good general guide that focuses on the basics of using uv to setup a venv and running commands. As probably more people would be profiting from such a guide, I've added one in scientific-python/cookie#829 to the scientific python website. Rendered version can be found at https://scientific-python-cookie--829.org.readthedocs.build/en/829/guides/uv/. If you have any suggestions, please add them either here or in that PR (or tell me in our next call).
Sadly, I don't have a good solution for this at the moment. There are a couple of open issues in uv, some with partial workarounds, eg astral-sh/uv#7945 and astral-sh/uv#9258 (comment). In my limited testing, it sufficed to uncomment the line once, then run |
JakobBD
left a comment
There was a problem hiding this comment.
Thanks for the tutorial!
Only thing "missing" from my point of view would be how to integrate that with VSCode (debugger and tests), though this tutorial is probably not the right place for that.
As I said, let's try this solution with the editable flodym. If it's too much of an annoyance in our daily workflow (I don't think it will be), we can still go the dirty way and uncomment the respective lines by default.
Thanks for the feedback. For vscode, it should correctly discover everything after you run
👍 |
Use `uv` in the readme (and to build the docs), instead of plain pip. Also change the build backend to uv (since its a bit faster, and still actively maintained which you cannot really say about setuptools). Background: If I understood Tonn correctly (to be double-checked tomorrow), then uv is the easiest way to create a reproducible venv on the cluster. But independently of the use case, uv is the modern replacement of pip.
Use
uvin the readme (and to build the docs), instead of plain pip.Also change the build backend to uv (since its a bit faster, and still actively maintained which you cannot really say about setuptools).
Background: If I understood Tonn correctly (to be double-checked tomorrow), then uv is the easiest way to create a reproducible venv on the cluster. But independently of the use case, uv is the modern replacement of pip.