Live data from Hacker News

What the Heck Is Pyproject.toml?

snarky.ca

131–140 of 199 posts

Re: What the Heck Is Pyproject.toml?

#132

Python desperately needs a better packaging solution than pip from Python Software Foundation. Stop all new features until this - the biggest pain point for Python across all expertise levels from newbies to experienced Python programmers - is officially solved. No pipenv, no poetry, no conda, etc from third party devs who sometimes get tired of the pressure [1]. It is immense. Combine all this virtualenv stuff with…

Yes the python environment space has exploded and now feels like JavaScript with multiple competing solutions and no obvious go-to one.

Re: What the Heck Is Pyproject.toml?

#133
post #88

Earlier quoted context omitted.

Do you mean installing Python itself or the needed packages? I think Python itself is really painless (just use os Python is you have a recent Linux or get it from Python.org). For end users just ship Python along with your app in the same package (Docker image, OS X bundle etc).

Using the system Python for development comes with its own problems. That Python is both an interpreter required by the system for numerous scripts and a runtime dependency for other packages. Using that gives people all sorts of problems, especially when "sudo pip install" is used. You can even break a system that way. Gentoo is the only distro on which I feel comfortable using the system interpreters because the ve…

I agree that there are potential problems w using system Python - the way I've had it work is to only support a recent Ubuntu distro and its Python version (latest LTS) and use the Python 3-included venv module for making a virtualenv. But yeah Docker is easier and more widely compatible, and works on Mac/Windows too.

Re: What the Heck Is Pyproject.toml?

#134
post #83
post #53

Earlier quoted context omitted.

Ruby serves one ecosystem (web), barely. Python serves several huge ones: web, datascience, 3d graphics, sysadmin... all with different needs, different conventions, different “standard” tools to do this and that. The community is orders of magnitude bigger than ruby by now, and anything that requires coordination is much harder to accomplish than in a lot of other ecosystems. Python is now on par with ecosystems lik…

Node does it better as well. So does java with maven which has been the dominant way to do it in java for over a decade.

left-pad comes to mind when you mention Node.

Re: What the Heck Is Pyproject.toml?

#135
post #90
post #83

Earlier quoted context omitted.

Node does it better as well. So does java with maven which has been the dominant way to do it in java for over a decade.

I would not use Node as an example of good packaging. It really hasn't been that long since left-pad. Then there's the fact that you still have multiple different tools to do the same thing (npm vs. yarn) and the end result node_modules/ is a fucking mess anyways. find node_modules/ -name "node_modules" | wc -l 327

ied ( http://gugel.io/ied/ ) had a great idea for reducing redundant installations in node_modules/, I wish the project got some traction. It worked as advertised when I used it 4 years ago.

Re: What the Heck Is Pyproject.toml?

#136

Earlier quoted context omitted.

Python also doesn't support yaml in the standard library, interestingly.

Yaml is a big mess. I do really like strict-yaml, however (last time I checked) it is just a hack to simplify the large PyYaml compiled package.

Thanks for the vote of confidence.

fwiw version 2.0 of strictyaml will feature its own specification and parser.

Re: What the Heck Is Pyproject.toml?

#137

I don’t want to be too negative, and I realize this isn’t an option for everyone ... but seriously, just use conda if you can. Judging from comments here and in the past, we all know packaging is one of Python’s Achilles’ heels. I spent a couple years bouncing around with pyenv/pipenv, then poetry, then back. I lovingly followed all the flamewars here and on github. Ultimately, I realize now, I laboured under the con…

I find the original virtualenv system works well. There's no need for virtualenvwrapper or pipenv or any of that nonsense. Just make a virtual environment whereever you like ("virtualenv -p python3 ~/envs/myenv" if you want to share between projects, or "virtualenv -p python3 path/to/project/env" if you don't). Use "pip install -r requirements.txt" if your project has one. Activating and deactivating is straightforward. Deleting a virtual environment is easiest of all - literally just delete the directory and you're done.

The main problem that Conda was originally meant to solve was that basic Python packaging (virtualenv, pip) required you to build C extensions yourself which is a huge pain (mostly getting all the C dependencies installed). But with the advent of binary wheels and (eventually, in 2016) a binary wheel standard for Linux [1] you can now get binary builds of most packages on most OSs by just doing a "pip install packagename" - typically this is even more likely to work than Conda in recent years.

The only limitation of virtualenv is it requires you to have already installed Python yourself. On Linux I just use the system-installed version (the Python 3 one obviously), but on Windows I use Conda to create the environments and then pip to install the packages, which works fine.

[1] https://www.python.org/dev/peps/pep-0513/

Re: What the Heck Is Pyproject.toml?

#138
post #109
post #65

Earlier quoted context omitted.

I see pip's behaviour being called "bizarre" and "baffling", an expectation that the "fix" should be easy (it never is: you "simply" add a flag, now some code paths bifurcate, now you need more tests, documentation should be updated and reviewed, etc.), no pull request, and the pip developer is still patiently explaining why pip's behaviour is not meeting with expectations. But really, it takes a lot of entitlement t…

I see a weird, surprising, unhelpful design, and a lot of critical comments being deleted.

Weird, surprising and unhelpful are value judgements on your part. It could be a security feature to someone else!

The hidden (not deleted) comments are hidden not because they contain criticism, but because of an unnecessarily harsh tone, which is unhelpful to anyone wanting to read up on the discussion at hand, and definitely not helpful for the motivation of anybody currently doing the unthankful work of maintaining pip. They do a very difficult job, where they have to deal with 20+ years of legacy, many different operating systems, many different Python distributions, many different skill levels in their user base, and even having to fight OSS fatigue due to unconstructive criticism. Pip is as good as it is due to their hard work, and we should be thankful to them.

Re: What the Heck Is Pyproject.toml?

#139
post #108

Earlier quoted context omitted.

> Python serves several huge ones: web, datascience, 3d graphics, sysadmin... all with different needs, different conventions, different “standard” tools to do this and that. Them having different conventions and standard tools is the failure, not a constraint. What are the different needs that these ecosystems have which mean they couldn't use a common package manager? I don't believe there are any.

For instance, in the scientific computing world, compiled extensions are hugely important, whereas they're relatively rare in web development. There's probably no logical reason why a single common package manager for these domains is impossible. But they have different priorities, and people write tools that solve their own problems. Who is going to decide which package managers are unnecessary, and convince all of…

> relatively rare in web development

not at all. from my previous experience with ruby i was using gems with compiled bindings to libraries for: mysql, memcached, json, xml, regexp and http. and probably some more i don't recall right now.

Re: What the Heck Is Pyproject.toml?

#140

Earlier quoted context omitted.

I am an experienced Python programmer. I often have to collaborate with people who are not. There is no greater hell than talking them through installing a working Python environment. It’s impossible. Meanwhile, the pip project is full of developers who tell you that your problem is not a problem and you’re discouraging people by pointing out that they’re blame shifting: https://github.com/pypa/pip/issues/4995 I hone…

> There is no greater hell than talking them through installing a working Python environment. It’s impossible. I give a lot of Python professional trainings, and I get to do that regularly, in very diverse situations. It's indeed full of gotchas. Since it's not going to be solved quickly, meanwhile, here is what works if you need to help people setuping python: 1 - Install Python correctly The first version Python do…

This is an awesome summary that should be placed on the python.org front page instead of all the fuzzy stuff that's there right now.
Post reply on HN