4 ms·
Another person here mentioned a comment "More overheads for infra tools to accomadate." I agree. I am using python as my main language these days, coming from
by xrd 2y ago
Another person here mentioned a comment "More overheads for infra tools to accomadate." I agree.
I am using python as my main language these days, coming from JS and C++ and a bit of rust. The biggest problem I face is that the tools (editors, mainly) don't support the basic packaging tools.
I use venv for everything, but when I try to use something else, I almost always get bitten.
For example, asdf. I tried to use this tool. So awesome! It works great from the command line. But, when I try to use zed, it cannot figure out what to do, and I cannot find references in the zed github repository on the right way to setup pyproject.toml.
And, emacs. Will uv work within emacs? Each of these packaging tools (and I'm thinking about the long history of nvm (node version manager), brew, and everything else) makes different assumptions about the right way to modify the path variable, or create aliases, or use shims (the definition of which varies with each tool) and I'm sure I'm missing other details.
Does uv do the right thing mostly? I will say my experiences with python and the tooling has been more frustrating than the tools for JS. I use pnpm and it just works, and I understand the benefits. And, I can survive with just npm and yarn. But, to me, it is saying a lot that the python tooling feels more broken than JS. I mean, I lived through the webpack years, and I'm still using JS and have a generally favorable opinion of it.
- codethief 2y agoCould you elaborate on the issues you've been seeing in Zed? I've been using asdf as a version manager for Python for quite some time and haven't really had any issues.
- xrd 2y agoYou are using asdf and zed successfully? I'm so glad to hear this. I removed asdf because I could not get it to recognize the pyproject.toml file. This is working in harmony for you? With Zed and a venv (from python -m venv .venv for example), Zed properly recognized installed packages and provided type hinting and docs, but when I switched to asdf it did not seem to work. But, I was new to asdf and perhaps was using it incorrectly. I was always assuming that when I'm in the command line, running asdf to use the right python works because the path is correctly established. But, when I run zed, it launches without the path setup step, and things went badly. I'm just speculating, but I could not get type hinting and didn't know how to fix it.
- codethief 2y agoSorry, I should have clarified: I have not used Zed but I've successfully used asdf (with Python) with many other IDEs and the challenges are usually the same. > I was always assuming that when I'm in the command line, running asdf to use the right python works because the path is correctly established In a typical setup asdf is installed by sourcing some shell script in your .bashrc (which will then add shims to your path). It might very well be that Zed didn't execute `python` in an interactive shell, so the shims weren't available. There are various solutions here but the easiest is probably to add the shims to your PATH yourself. As for venvs, using asdf doesn't mean you should no longer use venvs since all projects using the same Python version (managed by asdf) will still share the same site-packages folder. In other words: I'd still recommend setting up a venv, e.g. through Poetry or uv/Rye. Besides, once .venv/bin/python symlinks the asdf Python shim, Zed might have an easier time finding the right binary, too.
- salomonk_mur 2y agoYes, uv generally does the right thing. I hold the same opinion as you. Python packaging is awful. But uv managed to just make it work.
- mixmastamyk 2y agouv and zed are very new—stick to mature tools and you’ll have a better time. Or forget about some editor integration in the meantime.