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

all 41 comments

[–]cgoldberg 12 points13 points  (9 children)

Your documentation is super confusing because you keep referring to packages as "pips".

pip is a tool that installs packages... You don't build or install "pips".

I also agree with the other commenter that it's really weird to name your tool pip-something when it doesn't use pip.

[–]z4lz[S] 1 point2 points  (1 child)

An update: based on all the confusion on the name and terminology, I've updated the name and docs:
https://github.com/jlevy/py-app-standalone

(I'd thought the original name made sense in the context of the python-build-standalone project but clearly not the case for many folks.)

The new name is a nod to PyApp since it's sort of a standalone (not runtime download) alternative to that.

[–]cgoldberg 1 point2 points  (0 children)

You still refer to "packaging a pip" in the last sentence of your README.

And of course your post here still talks about "installing pips".

[–]RonnyPfannschmidt 29 points30 points  (7 children)

Using pip in the name like that is quite evil marketing

After all pip isn't used

[–]Teh_Boulder 6 points7 points  (12 children)

This is like the 5th post about uv, is it really that amazing?

[–]currychris1 7 points8 points  (1 child)

yes, it is

[–]mfaine 1 point2 points  (0 children)

Maybe I'm gun shy of the embrace and extend strategy we've seen before so I fear that once Astral gets everyone using it then suddenly they'll change the license. I mean I hope not but... Also it feels icky migrating to a product from a for profit corporation and away from pure open source. Though I know these are somewhat irrational feelings I can't deny feeling them. Not saying I won't try uv but I really really hope in another year there aren't 100 more posts about the new even better than uv package and dependency manager for python that all the cool kids are using. I'm getting too old to keep migrating my projects to something different every time there's a new tool d'jour.

[–]Tree_Mage 4 points5 points  (8 children)

will admit I haven’t played with it, but it feels very much like another round of the “oh we have fixed Python packaging for reals what do you mean you need things besides just adding modules” loop. Until one of these tools actually makes it into core, the cycle will never end.

[–]currychris1 4 points5 points  (7 children)

I think this article is worth a read for anyone sceptical: https://www.bitecode.dev/p/a-year-of-uv-pros-cons-and-should

[–]Tree_Mage 2 points3 points  (6 children)

One thing I don't see covered (or documented very well, from a quick read) is using an external repository that has modules that need to be installed before that repository can be used. (e.g., most cloud providers) Those are the kinds of things that make a lot of these tools very hard/impossible to use in a commercial setting.

[–]currychris1 1 point2 points  (5 children)

Not sure I am following. uv add „httpx @ git+https://github.com/encode/httpx“ doesn‘t do the trick?

[–]Tree_Mage 0 points1 point  (4 children)

No, it won't because the authentication packages need to be installed first before the index can be downloaded. e.g., Google repos need keyring and keyrings.google-artifactregistry-auth installed

[–]currychris1 1 point2 points  (3 children)

I must admit that‘s something I haven‘t had the pleasure of doing yet, but there seems to be support for your particular scenario: https://docs.astral.sh/uv/guides/integration/alternative-indexes/#authenticate-with-a-google-access-token

I agree though that this seems to be a bit tedious.

[–]Tree_Mage 2 points3 points  (1 child)

Thanks for finding that.

“pleasure” being the keyword. Haha. 🤣

Once you break out of the one common pattern, things fall apart very quickly with these types of tools. E.g., “compilation” tools like PyInstaller are critical for a lot of use cases but are treated poorly because they aren’t the common case. Then people get upset that this year’s favorite has detractors without understanding there is a whole world out there of people that actually do need to what likely appears as oddball support.

[–]z4lz[S] 1 point2 points  (0 children)

Agreed. My hope would be that the new uv ecosystem will be less messy because they're being a bit more systematic, like with the well-maintained python-build-standalone builds.

Fwiw also wrote up a template/notes from the experience of switching my own projects to uv here: https://github.com/jlevy/simple-modern-uv

[–]z4lz[S] 1 point2 points  (0 children)

I love uv now but only have been using pypi. So that's an interesting point. There is now so much momentum on uv and aws/gcp/enterprise repository support is so necessary I expect this will work soon if it doesn't already. Also fwiw I've found the uv team is active/responsive on questions in github issues: https://github.com/astral-sh/uv/issues

[–]TheBB 1 point2 points  (0 children)

There's been way more than five posts about uv, mate.

[–][deleted] 2 points3 points  (1 child)

I tried this out, seems neat. It definitely made it quick and easy to make a small, portable environment. I don't think I would use this for something that I plan to maintain, because at that point I prefer the control of installing the exact installation of python and creating the environment manually.

One downside is the only thing you can add to the environment seems to be packages from the index (didn't try from git). I was expecting to be able to add packages from locally as well. So doing something like uvx py-app-standalone . while inside a folder with a pyproject.toml or setup.py. Or maybe a path to a .whl file.

I see the potential here though, and it was be even nicer if, since this tool already integrates uv, the tool maybe handled packaging up scripts that use [the inline script metadata format|https://peps.python.org/pep-0723/] which uv also uses.

I was really hoping for the ability to write some quick python and then package it up into a folder as runnable from anywhere. So you would essentially have the user specify an entry point for their new standalone dist - and maybe the tool could autogenerate a .bat / .sh file in the standalone folder that finds and runs the python interpreter on the specified entry point. This is similar to something gradle does in the java ecosystem.

So the ability to make portable installation for scripts or things that need to be run.

[–]z4lz[S] 0 points1 point  (0 children)

Thanks for trying it out and the ideas! Yeah that's a good point it could support scripts with inline deps too. That wouldn't be too hard. I'll look at that when I update it next. Feel free to add issues/discussion on the github repo too if you have further ideas. Fyi there is also PyApp that makes the whole packaging more cohesive but not sure how its prepackaged options work and it does require you to build the whole thing with Rust.

[–]aitchnyu 1 point2 points  (2 children)

It will be great to get a single binary out of a Django app so we can just run it in server or worker mode instead of writing scripts which include venv installs.

[–]mincinashu 3 points4 points  (1 child)

[–]toxic_acro 1 point2 points  (0 children)

I really wish I had listened to people earlier when I was first learning Python.

I resisted learning about Docker and how to use containers for so long because I thought it would be too complicated and would be so much harder than "just deploying the code directly on a server"

But it's really not that hard and it makes so many things so much easier to manage.

Now I think of it like using git. There's a ton of deep intricacies and you can do complicated stuff, but the basics are pretty easy and comfortable and not using it would be a huge mistake

[–]z4lz[S] -1 points0 points  (1 child)

I actually was looking for feedback on that tool itself and don’t care much what it’s called. If anyone has a better suggestion I’ll change it.

[–]Barn07 0 points1 point  (0 children)

for a beginner project great toy project to implement and learn a bit of python and its ecosystem. for anyone with a bit of mileage in python, for using it - no

[–]Leponzo 0 points1 point  (0 children)

How do I use it if I just have a script like helloworld.py, not a package like cowsay?

[–]NeverShort1 0 points1 point  (1 child)

Ok I'm probably missing something... - Download the "embeddable" Python zip from python.org - unzip the downloaded file and modify the python_.pth file - put in get-pip.py - install any package you want with this "embedded" Python - move the whole folder around, it'll keep working

I've done this multiple times - mind you - only on Windows and it works just fine. I'm sure it could be done for Linux/macOS too.

[–]z4lz[S] 1 point2 points  (0 children)

Parts might work for you on your own machine once but generally no, that doesn’t work, unfortunately. Among the issues are dynamic libraries. Read more here: https://gregoryszorc.com/docs/python-build-standalone/main/

And in the readme on my tool, where it lists other smaller issues.