Live data from Hacker News

Current State of Python Packaging

stefanoborini.com

61–70 of 77 posts

Re: Current State of Python Packaging

#61

Earlier quoted context omitted.

I like poetry but it comes with 2 problems: - it uses only pyproject.toml. Despite the current com on this format, it's not stable, it's an incomplete standard and it's not well supported by the ecosystem. Setup.cfg is a much better alternative in the mean time. In fact, just the auto include features make it better. - there is no nice way to install it. Pip install poetry is the usual one, and it got many gotchas fo…

The point about the beginners is solid, but consider the use case for Poetry: you need it if you want to package and publish a library, which is not an area I would associate with beginners.

To be less blunt, I made a better comment on how to package things in the modern python world:

https://news.ycombinator.com/item?id=20132303

No poetry necessary, but I point to when I use it anyway.

Re: Current State of Python Packaging

#62

Earlier quoted context omitted.

I like poetry but it comes with 2 problems: - it uses only pyproject.toml. Despite the current com on this format, it's not stable, it's an incomplete standard and it's not well supported by the ecosystem. Setup.cfg is a much better alternative in the mean time. In fact, just the auto include features make it better. - there is no nice way to install it. Pip install poetry is the usual one, and it got many gotchas fo…

Agree; there are multiple issues in Poetry's Github associated with installing inside Docker. If that's fixed, I'd be much happier with it.

Also with travis. And requires some manual fiddling with tox. Not to mention IDE support.

Re: Current State of Python Packaging

#63
post #51

Earlier quoted context omitted.

It was NEVER recommended by any Python organization or official person, it was just Kenneth's usual bullshit marketing.

So my question is: who is in charge at PyPA, and how much Kenneth involved in it?

I woudln't trust PyPA, Kenneth or not. They have been taking very dubious is decisions in the past just for the sake of it.

The way forced a half baked pyproject.toml format to be a standard and refused to hear any complaint, all that while there have been a working open format existing, and working for 2 years was not very professional.

Re: Current State of Python Packaging

#64

I get mad at the Haskell tools I use every day, and then I remember that nobody else is really in better shape.

Python packaging is not hard really. It's just that there is way to much of obsolete or incomplete information on the web.

Here is what you need to know: https://news.ycombinator.com/item?id=20132303

Honestly, it's not much. It's enough to live a happy life as a Python dev.

Re: Current State of Python Packaging

#65
post #28

I get mad at the Haskell tools I use every day, and then I remember that nobody else is really in better shape.

Web browsers have the best software distribution story. You type a natural language query about what you want, click and it installs and runs the latest version of everything you need, usually in less than a second.

From the click user point of view, yeah.

From the dev user or packager point of view, no.

First, there is no namespace in JS. Secondly, the import instruction standard is not implemented everywhere, so we need a bundler. First, the network makes everything harder. And finally, JS has virtually no stdlib.

Add to that that we we are stuck in npm land, with acute lefpadite, packages breaking the public API every sunday, and a mad hatter packager like webpack as our lord and savior, and you have a recipe for terrible times.

Re: Current State of Python Packaging

#66
The top question Python learners ask me is:

How do I package my Python program for small scale distribution to non-technical people?

The end target is usually Windows so I suggest PyInstaller but it doesn't feel exactly elegant although it is better than py2exe.

Maybe there is some alternative on the horizon?

Re: Current State of Python Packaging

#67

Earlier quoted context omitted.

> Python packaging is not hard anymore Would you tell us which is "the right way to do it" nowadays? Possibly, in a maintainable, kind-of-officially supported way that doesn't change or disappear in a few months? Please note: I use Python professionally since 2005, I've been involved a lot in Python packaging for production apps (including giving some talks on the bad state of Python packaging at Europython around 20…

Here we go :) Packaging, the easy way Because I'm not on a blog, I can't go too much into details, and I'm sorry about that. It would be better to take more time on each point, but use them as starting point. I'll assume you know what virtualenv and pip. If you don't, check a tutorial on them first, it's important. But I'm going to go beyond packaging, because it will make your life much easier. If you want to skip c…

Oh, almost forget.

6 - If you want to compile Python to an exe, use nuitka (http://nuitka.net/), not p2exe, cx_freeze and co.

Re: Current State of Python Packaging

#68
post #66

The top question Python learners ask me is: How do I package my Python program for small scale distribution to non-technical people? The end target is usually Windows so I suggest PyInstaller but it doesn't feel exactly elegant although it is better than py2exe. Maybe there is some alternative on the horizon?

If they can get away without packaging the interpreter, there is always an executable zip. There's a pretty handy tool for creating them:

https://github.com/linkedin/shiv

Re: Current State of Python Packaging

#69
post #66

The top question Python learners ask me is: How do I package my Python program for small scale distribution to non-technical people? The end target is usually Windows so I suggest PyInstaller but it doesn't feel exactly elegant although it is better than py2exe. Maybe there is some alternative on the horizon?

PyInstaller is quite adequate and works well. The only problem is that all it gives you is an exe. If you want something a bit more complex it's not really much more than that.

Re: Current State of Python Packaging

#70
My own anecdotal experience was that I couldn't get poetry to install on a fresh instance of Ubuntu. There were some open issues for it on the Poetry issue tracker but the developer was implying it was an Ubuntu issue rather than a problem with Poetry.
Post reply on HN