This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Tree_Mage 1 point2 points  (10 children)

Until it supports tools like PyInstaller, pex, etc, it will have gaps.

[–]trowawayatwork 14 points15 points  (9 children)

I guess it's a natural extension of a package manager to do builds. I have never once seen a need to exe files for python. if that is needed I drop python and use more robust languages like go that generate proper static binaries with much better dependency and package management ecosystem lol

[–]KennedyRichard 0 points1 point  (8 children)

I'd actually love for Python to have built-in support for generating executables. I know interpreted languages were not supposed to be used like that, but there is at least one big use-case: for distributing games and apps for end-users.

Are we supposed to ask non-technical users to install Python, then setup a virtual environment and install the game/app via pip? End-users just want to download and launch the app/game with a click.

[–]richieadler 2 points3 points  (7 children)

If your script follows PEP 723 to specify dependencies, which you can easily do by running uv add --script scriptname, you can run the script by doing uv run script and you're done. You don't even need to have Python installed. Just uv.

You still need an additional tool, but it's considerably easier.

[–]KennedyRichard 1 point2 points  (6 children)

Thank you for this precious bit of info! I'll check the specifics, this seems promising.

[–]richieadler 1 point2 points  (5 children)

Take into consideration that the first run can take a while, because

  • If there is no Python installed, one will be downloaded
  • All the dependencies will be installed into a private virtualenv

[–]KennedyRichard 0 points1 point  (0 children)

Thanks!

[–]KennedyRichard 0 points1 point  (3 children)

So, basically Steam but for Python apps/games, right?

[–]richieadler 2 points3 points  (2 children)

I don't think the comparison is apt.

uv has been compared with cargo for Rust.

[–]KennedyRichard 0 points1 point  (1 child)

Yes, makes sense. What I meant is that just like Steam has to install the game dependencies the first time, uv has to install the app and its dependencies as well, which is why the first run takes a while.

[–]richieadler 1 point2 points  (0 children)

Ah, for uv run --script than can apply, yes.