News for hackers. Stuff that matters.
Re:How to make a Python package in 2021 by blondin on Wednesday April 07, 2021 @11:53PM (#26734934)
yea, it is. but it's a sane thing to do. recommending poetry for a beginner is a bad idea. (nothing against that package).

python is a mature, old, software system. three times older than go or rust. way older than zig. these modern languages have learned from the field as a whole and implemented tools that people are taking for granted nowadays.

as with any mature software system, people & companies have established their preferred ways of doing things. it's going to be hard to have the language council dictate ways of doing things.

i would recommend going simple and using the standard set of modules until poetry or whatever gets into it.

Re:How to make a Python package in 2021 by feu on Thursday April 08, 2021 @05:26AM (#26736765)
Recommending the standard set of modules is the opposite of "going simple." Poetry removes a lot of the complexity and user-unfriendliness inherent in the previous set of standard modules. For any Python beginner coming from another popular language Poetry is likely going to be very similar to the dependency and package management in the language they're coming from. Python's standard set of modules sticks out like a sore thumb when compared to the tools in other popular languages.
Re:How to make a Python package in 2021 by staticassertion on Thursday April 08, 2021 @12:43AM (#26735165)
Well, Python did set up a standard - pyproject.toml. And it's what poetry uses. It's just, uh, "light".
Re:How to make a Python package in 2021 by goerz on Thursday April 08, 2021 @01:11AM (#26735287)
It's also not ready yet, missing critical features like editable installs. Right now, you still need a shim setup.py. Until pyproject.toml can actually replace setupy.py, I see little incentive to start using it: It's just one more file to add. The one exception is if the package actually has build requirements, e.g. for Cython modules.
Re:How to make a Python package in 2021 by zo1 on Thursday April 08, 2021 @02:36AM (#26735774)
The only reason we use pyproject.toml is because of the stupid black formatter that refuses to support setup.cfg, which every other python tool under the sun supports.
Re:How to make a Python package in 2021 by goerz on Thursday April 08, 2021 @02:52PM (#26742347)
Yeah, it's annoying. But Black has so little configuration that I'm ok with hardcoding command-line parameters in my Makefile/tox.ini/precommit hooks (`--skip-string-normalization --line-length 79`)
Re:How to make a Python package in 2021 by mixmastamyk on Thursday April 08, 2021 @04:22AM (#26736349)
There are other formatters, some may even be better.
Re:How to make a Python package in 2021 by cixinlui on Thursday April 08, 2021 @05:12AM (#26736682)
I don't recognize this. I use poetry all the time, without setup.py and the local installs are editable. I have published half a dozen packages which don't have a setup.py and they all work fine.
Re:How to make a Python package in 2021 by neolog on Thursday April 08, 2021 @08:01PM (#26745274)
You can't install a poetry package editably into another environment. It's really a missing feature in the pyproject spec. There's an open issue about it under one of the pypa repos. Someone just needs to do the work of implementing it in pip/setuptools.
Re:How to make a Python package in 2021 by neolog on Thursday April 08, 2021 @05:40PM (#26744106)
> recommending poetry for a beginner is a bad idea.

Strongly disagree. There are so many footguns with low-level tools like pip that I can't recommend it to anybody but an expert (but an expert doesn't need my recommendation anyway).